From 6acdce856f81c2c2adc02e56a97b5db19e2741f9 Mon Sep 17 00:00:00 2001 From: Christos Zoulas Date: Wed, 7 May 2014 10:13:12 +0000 Subject: [PATCH] Fix for uninialized title (Jan Kaluza) --- ChangeLog | 4 ++++ src/readcdf.c | 7 +++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 6873a5fc..77a5218f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2014-05-06 6:12 Christos Zoulas + + * Fix uninitialized title in CDF files (Jan Kaluza) + 2014-05-04 14:55 Christos Zoulas * PR/351: Fix compilation of empty files diff --git a/src/readcdf.c b/src/readcdf.c index be5e4c25..aea9cf19 100644 --- a/src/readcdf.c +++ b/src/readcdf.c @@ -26,7 +26,7 @@ #include "file.h" #ifndef lint -FILE_RCSID("@(#)$File: readcdf.c,v 1.41 2014/05/05 16:11:21 christos Exp $") +FILE_RCSID("@(#)$File: readcdf.c,v 1.42 2014/05/07 10:13:12 christos Exp $") #endif #include @@ -173,12 +173,11 @@ cdf_file_property_info(struct magic_set *ms, const cdf_property_info_t *info, if (info[i].pi_type == CDF_LENGTH32_WSTRING) k++; s = info[i].pi_str.s_buf; - for (j = 0; j < sizeof(vbuf) && len--; - j++, s += k) { + for (j = 0; j < sizeof(vbuf) && len--; s += k) { if (*s == '\0') break; if (isprint((unsigned char)*s)) - vbuf[j] = *s; + vbuf[j++] = *s; } if (j == sizeof(vbuf)) --j; -- 2.50.0