From: Christos Zoulas <christos@zoulas.com>
Date: Wed, 30 Mar 2011 19:48:13 +0000 (+0000)
Subject: fix cdf buffer setting offset.
X-Git-Tag: FILE5_06~7
X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=48047b9e8d30f23f79da59406aec4e208086053b;p=file

fix cdf buffer setting offset.
---

diff --git a/ChangeLog b/ChangeLog
index 0ea72424..91f59dcd 100644
--- 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
diff --git a/src/cdf.c b/src/cdf.c
index e2c8b1eb..3d4d2b22 100644
--- 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));