From: Lutz M?l. <lu...@us...> - 2004-05-26 22:27:16
|
Update of /cvsroot/libexif/libexif/libexif In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8520/libexif Modified Files: exif-entry.c Log Message: 2004-05-27 Lutz Mueller <lu...@us...> * libexif/exif-entry.c: According to Ralf Holzer <rh...@cm...>, the user comment field does not have to be NULL terminated. Index: exif-entry.c =================================================================== RCS file: /cvsroot/libexif/libexif/libexif/exif-entry.c,v retrieving revision 1.52 retrieving revision 1.53 diff -u -d -r1.52 -r1.53 --- exif-entry.c 24 May 2004 12:13:20 -0000 1.52 +++ exif-entry.c 26 May 2004 22:27:06 -0000 1.53 @@ -338,10 +338,18 @@ switch (e->tag) { case EXIF_TAG_USER_COMMENT: + + /* + * According to Ralf Holzer <rh...@cm...>, + * the user comment field does not have to be + * NULL terminated. + */ CF (e->format, EXIF_FORMAT_UNDEFINED, val, maxlen); if (e->size < 8) break; strncpy (val, e->data + 8, MIN (e->size - 8, maxlen)); + if (maxlen > e->size - 8) val[e->size - 8] = '\0'; break; + case EXIF_TAG_EXIF_VERSION: CF (e->format, EXIF_FORMAT_UNDEFINED, val, maxlen); CC (e->components, 4, val, maxlen); |