Skip to content

Commit

Permalink
simplify safety check logic
Browse files Browse the repository at this point in the history
The file size would have already been checked by the attrsz check, so
this check works implicitly, and works when the file size is not
available (streams)

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

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

0 comments on commit 7b3c965

Please sign in to comment.