From 656fee036a01de50bcbb25dc7470c8cf9f3714da Mon Sep 17 00:00:00 2001 From: Jonathan Bell Date: Thu, 8 Aug 2024 09:55:40 -0400 Subject: [PATCH] Not sure how this ever become negative... --- .../java/edu/berkeley/cs/jqf/fuzz/ei/ir/TypedInputStream.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fuzz/src/main/java/edu/berkeley/cs/jqf/fuzz/ei/ir/TypedInputStream.java b/fuzz/src/main/java/edu/berkeley/cs/jqf/fuzz/ei/ir/TypedInputStream.java index fdb613d9f..58db3539d 100644 --- a/fuzz/src/main/java/edu/berkeley/cs/jqf/fuzz/ei/ir/TypedInputStream.java +++ b/fuzz/src/main/java/edu/berkeley/cs/jqf/fuzz/ei/ir/TypedInputStream.java @@ -87,7 +87,7 @@ public String readString(List dictionary) throws IOException { TypedGeneratedValue ret = readValue(TypedGeneratedValue.Type.String); bytesRead+=4; //Historically JQF has counted strings as 4 bytes (an int into a dictionary) positionInInput++; - return dictionary.get(((TypedGeneratedValue.StringValue) ret).keyNotBoundedBySize % dictionary.size()); + return dictionary.get(Math.abs(((TypedGeneratedValue.StringValue) ret).keyNotBoundedBySize % dictionary.size())); } public char readChar() throws IOException {