From 7b3c965a9552226eb27b6792826bf110f8dff946 Mon Sep 17 00:00:00 2001 From: Kimball Thurston Date: Thu, 26 Sep 2024 18:29:39 +1200 Subject: [PATCH] simplify safety check logic 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 --- src/lib/OpenEXRCore/parse_header.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/lib/OpenEXRCore/parse_header.c b/src/lib/OpenEXRCore/parse_header.c index 576aa9fc6..1701298c3 100644 --- a/src/lib/OpenEXRCore/parse_header.c +++ b/src/lib/OpenEXRCore/parse_header.c @@ -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,