Fix a small issue with strptime stable/1.x
authorKlaus Ethgen <Klaus@Ethgen.de>
Sun, 28 Feb 2010 15:17:12 +0000 (15:17 +0000)
committerKlaus Ethgen <Klaus@Ethgen.de>
Sat, 26 May 2012 13:48:47 +0000 (14:48 +0100)
strptime do not initialize all fields. So the undefined fields could end
in crash later on.

src/exif-common.c

index 84ebef5..f87d141 100644 (file)
@@ -207,6 +207,7 @@ static gchar *exif_build_formatted_DateTime(ExifData *exif)
                }
 
        /* Convert the stuff into a tm struct */
+       memset(&tm, 0, sizeof(tm)); /* Uh, strptime could let garbage in tm! */
        if (text && strptime(text, "%Y:%m:%d %H:%M:%S", &tm))
                {
                buflen = strftime(buf, sizeof(buf), "%x %X", &tm);