Skip to content

Commit

Permalink
Merge pull request #404 from talex5/fix-fuzzing
Browse files Browse the repository at this point in the history
Fix off-by-one in fuzz test
  • Loading branch information
talex5 authored Jan 6, 2023
2 parents 670e656 + 33b27ce commit 5407ed6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fuzz/fuzz_buf_read.ml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ module Model = struct
| Some (line, rest) ->
if String.length line >= max_size then raise Buffer_limit_exceeded;
t := rest;
if String.ends_with ~suffix:"\r" line then String.sub line 0 (String.length line - 2)
if String.ends_with ~suffix:"\r" line then String.sub line 0 (String.length line - 1)
else line
| None when !t = "" -> raise End_of_file
| None when String.length !t >= max_size -> raise Buffer_limit_exceeded
Expand Down

0 comments on commit 5407ed6

Please sign in to comment.