Skip to content

Commit

Permalink
Fix runtime failure on 32bit platforms
Browse files Browse the repository at this point in the history
  • Loading branch information
Christopher Zimmermann committed Jun 1, 2024
1 parent 27095d5 commit d34ab77
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/zlib_stubs.c
Original file line number Diff line number Diff line change
Expand Up @@ -460,8 +460,10 @@ CAMLprim value zlib_flate(value vstrm, value flush)
strm->avail_in -= LField(3);
strm->avail_out -= LField(4);
/* given substring inside bigarray bounds? */
if (LField(3) < 0 || LField(4) < 0 ||
LField(5) > strm->avail_in || LField(6) > strm->avail_out)
if (LField(3) < 0 ||
LField(4) < 0 ||
LField(5) > (value)strm->avail_in ||
LField(6) > (value)strm->avail_out)
caml_invalid_argument("Zlib.flate");
/* if given length is negative use default and return it. */
if (LField(5) < 0)
Expand Down

0 comments on commit d34ab77

Please sign in to comment.