changeset 1808:6c61c246506b

Fix a small issue with strptime strptime do not initialize all fields. So the undefined fields could end in crash later on.
author mow
date Sun, 28 Feb 2010 15:17:12 +0000
parents 3a2aff957816
children e1c18f81e637
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);