From 05c599b975e46ba52d4f9285726bf70894f6dff7 Mon Sep 17 00:00:00 2001 From: Klaus Ethgen Date: Sun, 28 Feb 2010 15:17:12 +0000 Subject: [PATCH] Fix a small issue with strptime strptime do not initialize all fields. So the undefined fields could end in crash later on. --- src/exif-common.c | 1 + 1 file changed, 1 insertion(+) 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); -- 2.20.1