]> granicus.if.org Git - file/commitdiff
Fix for uninialized title (Jan Kaluza)
authorChristos Zoulas <christos@zoulas.com>
Wed, 7 May 2014 10:13:12 +0000 (10:13 +0000)
committerChristos Zoulas <christos@zoulas.com>
Wed, 7 May 2014 10:13:12 +0000 (10:13 +0000)
ChangeLog
src/readcdf.c

index 6873a5fca139eda809f52d8150eed49876e60efb..77a5218fa05ef8e67ecac176f72cc5b537edcb00 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2014-05-06  6:12  Christos Zoulas <christos@zoulas.com>
+
+       * Fix uninitialized title in CDF files (Jan Kaluza)
+
 2014-05-04  14:55  Christos Zoulas <christos@zoulas.com>
 
        * PR/351: Fix compilation of empty files 
index 833cd0c7080a0987d750b33712df9c3f567a8129..4e6e55529393f89cb294967dd4b36f88d96906e0 100644 (file)
@@ -26,7 +26,7 @@
 #include "file.h"
 
 #ifndef lint
-FILE_RCSID("@(#)$File: readcdf.c,v 1.40 2014/03/06 15:23:33 christos Exp $")
+FILE_RCSID("@(#)$File: readcdf.c,v 1.41 2014/05/05 16:11:21 christos Exp $")
 #endif
 
 #include <assert.h>
@@ -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;