Thu Jun 9 23:22:01 2005 John Ellis <johne@verizon.net>
authorJohn Ellis <johne@verizon.net>
Fri, 10 Jun 2005 03:24:35 +0000 (03:24 +0000)
committerJohn Ellis <johne@verizon.net>
Fri, 10 Jun 2005 03:24:35 +0000 (03:24 +0000)
        * exif.c (exif_parse_JPEG): Use memcmp as strncmp is inadequate when
        bytes with values of 0 are actually in the data to compare.

ChangeLog
src/exif.c

index 94a175e..f4395b9 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Thu Jun  9 23:22:01 2005  John Ellis  <johne@verizon.net>
+
+       * exif.c (exif_parse_JPEG): Use memcmp as strncmp is inadequate when
+       bytes with values of 0 are actually in the data to compare.
+
 Thu Jun  9 22:23:18 2005  John Ellis  <johne@verizon.net>
 
        * exif.[ch]: A lot of code clean up, add generic tiff header parser,
index 4cc3e57..03918df 100644 (file)
@@ -997,7 +997,7 @@ static gint exif_parse_JPEG(ExifData *exif, unsigned char *data, guint size, Exi
 
        marker_size = jpeg_get_marker_size(data) - 2;
                
-       if (marker_size < 6 || strncmp((char*)data + 4, "Exif\0\0", 6) != 0)
+       if (marker_size < 6 || memcmp(data + 4, "Exif\x00\x00", 6) != 0)
                {
                return -2;
                }