Skip to content

Commit

Permalink
Fix unterminated string causing issue with print
Browse files Browse the repository at this point in the history
Fixes OSS Fuzz 39196

Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
  • Loading branch information
kdt3rd committed Sep 25, 2021
1 parent 82f703a commit 9422727
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/lib/OpenEXRCore/parse_header.c
Original file line number Diff line number Diff line change
Expand Up @@ -226,13 +226,16 @@ read_text (
}
*outlen = namelen;
if (namelen > maxlen)
{
text[maxlen - 1] = '\0';
return ctxt->print_error (
ctxt,
EXR_ERR_NAME_TOO_LONG,
"Invalid %s encountered: start '%s' (max %d)",
type,
text,
maxlen);
}
return EXR_ERR_SUCCESS;
}

Expand Down

0 comments on commit 9422727

Please sign in to comment.