Skip to content

Commit

Permalink
Fixes a use-after-free when an invalid type string is provided
Browse files Browse the repository at this point in the history
This fixes Google OSS-FUZZ 39212.

Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
  • Loading branch information
kdt3rd committed Sep 25, 2021
1 parent c4847d2 commit 82f703a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/lib/OpenEXRCore/parse_header.c
Original file line number Diff line number Diff line change
Expand Up @@ -1432,14 +1432,14 @@ check_populate_type (
curpart->storage_mode = EXR_STORAGE_DEEP_TILED;
else
{
exr_attr_list_remove (
(exr_context_t) ctxt, &(curpart->attributes), curpart->type);
curpart->type = NULL;
return ctxt->print_error (
rv = ctxt->print_error (
ctxt,
EXR_ERR_INVALID_ATTR,
"attribute 'type': Invalid type string '%s'",
outstr);
exr_attr_list_remove (
(exr_context_t) ctxt, &(curpart->attributes), curpart->type);
curpart->type = NULL;
}

return rv;
Expand Down

0 comments on commit 82f703a

Please sign in to comment.