fix: prevent potential off-by-1 error in internal mapOf() helper (#107)
All checks were successful
CI / build-with-it (11, 1.2.0) (push) Successful in 43s
CI / build-with-it (11, 1.20.0) (push) Successful in 53s
CI / build-with-it (17, 1.2.0) (push) Successful in 40s
CI / build-with-it (17, 1.20.0) (push) Successful in 52s
CI / build-with-it (21, 1.2.0) (push) Successful in 41s
CI / build-with-it (true, 21, 1.20.0) (push) Successful in 45s

This commit is contained in:
2025-08-30 09:41:09 +02:00
parent e30a3bd93a
commit bac06c5d19
2 changed files with 3 additions and 1 deletions

View File

@@ -3,6 +3,8 @@
### Dependencies
* Updated Jackson to 2.20.0 (#106)
### Fix
* Prevent potential off-by-1 error in internal `mapOf()` helper (#107)
## 1.5.2 (2025-07-16)

View File

@@ -732,7 +732,7 @@ public class HTTPVaultConnector implements VaultConnector {
*/
private static Map<String, Object> mapOf(Object... keyValues) {
Map<String, Object> map = new HashMap<>(keyValues.length / 2, 1);
for (int i = 0; i < keyValues.length; i = i + 2) {
for (int i = 0; i < keyValues.length - 1; i = i + 2) {
Object key = keyValues[i];
Object val = keyValues[i + 1];
if (key instanceof String && val != null) {