Skip to content

Commit bac06c5

Browse files
committed
fix: prevent potential off-by-1 error in internal mapOf() helper (#107)
1 parent e30a3bd commit bac06c5

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
### Dependencies
44
* Updated Jackson to 2.20.0 (#106)
55

6+
### Fix
7+
* Prevent potential off-by-1 error in internal `mapOf()` helper (#107)
68

79
## 1.5.2 (2025-07-16)
810

src/main/java/de/stklcode/jvault/connector/HTTPVaultConnector.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -732,7 +732,7 @@ private static Map<String, String> mapOfStrings(Object... keyValues) {
732732
*/
733733
private static Map<String, Object> mapOf(Object... keyValues) {
734734
Map<String, Object> map = new HashMap<>(keyValues.length / 2, 1);
735-
for (int i = 0; i < keyValues.length; i = i + 2) {
735+
for (int i = 0; i < keyValues.length - 1; i = i + 2) {
736736
Object key = keyValues[i];
737737
Object val = keyValues[i + 1];
738738
if (key instanceof String && val != null) {

0 commit comments

Comments
 (0)