Skip to content

Commit

Permalink
do not allow string lengths larger than the remaining data within the…
Browse files Browse the repository at this point in the history
… string vector

Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
  • Loading branch information
kdt3rd committed Sep 26, 2024
1 parent cf08f88 commit f18a951
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/lib/OpenEXRCore/parse_header.c
Original file line number Diff line number Diff line change
Expand Up @@ -607,7 +607,8 @@ extract_attr_string_vector (

pulled += sizeof (int32_t);
nlen = (int32_t) one_to_native32 ((uint32_t) nlen);
if (nlen < 0 || (ctxt->file_size > 0 && nlen > ctxt->file_size))
if (nlen < 0 || nlen > (attrsz - pulled) ||
(ctxt->file_size > 0 && nlen > ctxt->file_size))
{
rv = ctxt->print_error (
ctxt,
Expand Down

0 comments on commit f18a951

Please sign in to comment.