#64 exif_entry_get_value no longer able to return failure

open
nobody
None
5
2007-01-09
2007-01-09
No

Since revision 1.78 of libexif/exif-entry.c, it is no longer possible for the caller of exif_entry_get_value to determine whether or not the call succeeded, and therefore whether the contents of the buffer is valid.

Known impact: This bug causes swiggle to be unable to correctly read exif data using libexif. There is a workaround for swiggle, but it has highlighted this issue as the root cause.

The patch which caused this issue was bug #1051994. The problem which the patch aimed to fix is only hidden by this patch, and the correct fix is to revert the patch, and ensure all callers of exif_entry_get_value handle failure correctly.

Within libexif, this means two calls in exif-data.c, both in exif_data_get_type_maker_note:

/* Canon */
if (!strcmp (exif_entry_get_value (em, value, sizeof (value)), "Canon"))
return EXIF_DATA_TYPE_MAKER_NOTE_CANON;

Something like:

if (exif_entry_get_value(em, value, sizeof(value)) && !strcmp(value, "Canon"))
return EXIF_DATA_TYPE_MAKER_NOTE_CANON;

would be more appropriate.

Similarly for the Nikon case immediately below.

Discussion


Log in to post a comment.