From c39ebc38888ced628798571b58e418d19432f539 Mon Sep 17 00:00:00 2001 From: John Ellis Date: Fri, 10 Jun 2005 03:24:35 +0000 Subject: [PATCH] Thu Jun 9 23:22:01 2005 John Ellis * 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 | 5 +++++ src/exif.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 94a175ec..f4395b9c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Thu Jun 9 23:22:01 2005 John Ellis + + * 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 * exif.[ch]: A lot of code clean up, add generic tiff header parser, diff --git a/src/exif.c b/src/exif.c index 4cc3e57b..03918dfb 100644 --- a/src/exif.c +++ b/src/exif.c @@ -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; } -- 2.20.1