Skip to content

Commit

Permalink
Sanity check for input buffer overruns in RLE uncompress
Browse files Browse the repository at this point in the history
Signed-off-by: Peter Hillman <peterh@wetafx.co.nz>
  • Loading branch information
peterhillman committed Feb 4, 2020
1 parent df987ca commit 3775001
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions OpenEXR/IlmImf/ImfRle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,11 @@ rleUncompress (int inLength, int maxLength, const signed char in[], char out[])
if (0 > (maxLength -= count))
return 0;

// check the input buffer is big enough to contain
// 'count' bytes of remaining data
if (inLength < 0)
return 0;

memcpy(out, in, count);
out += count;
in += count;
Expand Down

0 comments on commit 3775001

Please sign in to comment.