Skip to content

Commit

Permalink
Fix assertion in Parser.Source.to_string_trim.
Browse files Browse the repository at this point in the history
  • Loading branch information
mefyl committed Jan 27, 2024
1 parent 3cd08e5 commit a8342a8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## Unreleased

- http: Fix assertion in `Source.to_string_trim` when `pos <> 0` (mefyl #1017)

## v6.0.0~beta2 (2024-01-05)

- cohttp-eio: Don't blow up Server on client disconnections. (mefyl #1011)
Expand Down
2 changes: 1 addition & 1 deletion http/src/http.ml
Original file line number Diff line number Diff line change
Expand Up @@ -944,7 +944,7 @@ module Parser = struct
"Http_parser.Source.substring: Index out of bounds., Requested \
off: %d, len: %d"
pos len);
let last = ref (t.pos + len - 1) in
let last = ref (t.pos + pos + len - 1) in
let pos = ref (t.pos + pos) in
while is_space (String.unsafe_get t.buffer !pos) do
incr pos
Expand Down

0 comments on commit a8342a8

Please sign in to comment.