From: Klaus Ethgen Date: Sun, 28 Feb 2010 15:17:12 +0000 (+0000) Subject: Fix a small issue with strptime X-Git-Url: http://geeqie.org/cgi-bin/gitweb.cgi?p=geeqie.git;a=commitdiff_plain;h=refs%2Fheads%2Fstable%2F1.x Fix a small issue with strptime strptime do not initialize all fields. So the undefined fields could end in crash later on. --- diff --git a/src/exif-common.c b/src/exif-common.c index 84ebef52..f87d141d 100644 --- a/src/exif-common.c +++ b/src/exif-common.c @@ -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);