Skip to content

Commit

Permalink
Fix a overrun
Browse files Browse the repository at this point in the history
data_offset + data_length could be bigger than guint which makes the
calculation overflow to a value smaller then size.
  • Loading branch information
mowgli committed Jul 18, 2009
1 parent 6e739c9 commit 7c7eb0a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/exif.c
Original file line number Diff line number Diff line change
Expand Up @@ -927,7 +927,7 @@ static gint exif_parse_IFD_entry(ExifData *exif, guchar *tiff, guint offset,
if (data_length > 4)
{
data_offset = data_val;
if (size < data_offset + data_length)
if (size < data_offset || size < data_offset + data_length)
{
log_printf("warning: exif tag %s data will overrun end of file, ignored.\n", marker->key);
return -1;
Expand Down

0 comments on commit 7c7eb0a

Please sign in to comment.