changeset 55:1e21f094e0be

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.
author gqview
date Fri, 10 Jun 2005 03:24:35 +0000
parents b58cac75ad12
children c722cbf9ad25
files ChangeLog src/exif.c
diffstat 2 files changed, 6 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Fri Jun 10 02:44:36 2005 +0000
+++ b/ChangeLog	Fri Jun 10 03:24:35 2005 +0000
@@ -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,
--- a/src/exif.c	Fri Jun 10 02:44:36 2005 +0000
+++ b/src/exif.c	Fri Jun 10 03:24:35 2005 +0000
@@ -997,7 +997,7 @@
 
 	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;
 		}