changeset 1808:c1a2cd480f76

Fix a small issue with strptime strptime do not initialize all fields. So the undefined fields could end in crash later on.
author Klaus Ethgen <Klaus@Ethgen.de>
date Sun, 28 Feb 2010 15:17:12 +0000
parents f653b50eba7b
children 40850a3d4289
files src/exif-common.c
diffstat 1 files changed, 1 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/exif-common.c	Sat Feb 27 23:31:07 2010 +0000
+++ b/src/exif-common.c	Sun Feb 28 15:17:12 2010 +0000
@@ -207,6 +207,7 @@
 		}
 
 	/* 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);