]> granicus.if.org Git - file/commitdiff
fix cdf buffer setting offset.
authorChristos Zoulas <christos@zoulas.com>
Wed, 30 Mar 2011 19:48:13 +0000 (19:48 +0000)
committerChristos Zoulas <christos@zoulas.com>
Wed, 30 Mar 2011 19:48:13 +0000 (19:48 +0000)
ChangeLog
src/cdf.c

index 0ea7242477c6d6fcb789d7b0daf463788f674ef0..91f59dcd26dbbf83be6609c87eacdc3422685b17 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2011-03-30  15:45  Christos Zoulas <christos@zoulas.com>
+
+       * Fix cdf string buffer setting (Sven Anders)
+
 2011-03-20  16:35  Christos Zoulas <christos@zoulas.com>
 
        * Eliminate MAXPATHLEN and use dynamic allocation for
index e2c8b1eb9fd4856cc7cb692c919f5c388923c5a0..3d4d2b223e628052eaf589a1cf764d3fb060c873 100644 (file)
--- a/src/cdf.c
+++ b/src/cdf.c
@@ -35,7 +35,7 @@
 #include "file.h"
 
 #ifndef lint
-FILE_RCSID("@(#)$File: cdf.c,v 1.42 2011/02/10 21:35:05 christos Exp $")
+FILE_RCSID("@(#)$File: cdf.c,v 1.43 2011/03/30 19:48:13 christos Exp $")
 #endif
 
 #include <assert.h>
@@ -846,8 +846,8 @@ cdf_read_property_info(const cdf_stream_t *sst, const cdf_header_t *h,
                        for (j = 0; j < nelements; j++, i++) {
                                uint32_t l = CDF_GETUINT32(q, o);
                                inp[i].pi_str.s_len = l;
-                               inp[i].pi_str.s_buf =
-                                   (const char *)(const void *)(&q[o4 + 1]);
+                               inp[i].pi_str.s_buf = (const char *)
+                                   (const void *)(&q[o4 + sizeof(l)]);
                                DPRINTF(("l = %d, r = %d, s = %s\n", l,
                                    CDF_ROUND(l, sizeof(l)),
                                    inp[i].pi_str.s_buf));