Skip to content

Commit

Permalink
Fix null byte addition during variable lookup
Browse files Browse the repository at this point in the history
  • Loading branch information
felixb1515 committed Jun 3, 2024
1 parent 6b3267d commit 94036bd
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/main/java/de/usd/cstchef/Utils.java
Original file line number Diff line number Diff line change
Expand Up @@ -217,8 +217,11 @@ public static HttpRequest addCookieToHttpRequest(HttpRequest request, Cookie coo
}

public static ByteArray insertAtOffset(ByteArray input, int start, int end, ByteArray newValue) {
ByteArray prefix = BurpUtils.subArray(input, 0, start);
ByteArray rest = BurpUtils.subArray(input, end, input.length());
ByteArray prefix = input.subArray(0, start);
ByteArray rest = input.subArray(0, 0);
if(end < input.length()) {
rest = input.subArray(end, input.length());
}

ByteArray output = prefix.withAppended(newValue).withAppended(rest);
return output;
Expand Down

0 comments on commit 94036bd

Please sign in to comment.