summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristos Zoulas <christos@zoulas.com>2021-09-17 17:42:14 +0000
committerChristos Zoulas <christos@zoulas.com>2021-09-17 17:42:14 +0000
commit46df39b68e51fd803d382348c0059fcb2e40b5ef (patch)
tree42a133dda27a6f4bd1fcb4c77e0fb4aa4ad87357
parenta9c8d2a9493c4e0cd201db57801f3502e65c686c (diff)
downloadfile-git-46df39b68e51fd803d382348c0059fcb2e40b5ef.tar.gz
Limit range of string printed (clusterfuzz)
-rw-r--r--src/cdf.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/cdf.c b/src/cdf.c
index 114f8fa3..76963cd8 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.117 2021/09/16 23:59:42 christos Exp $")
+FILE_RCSID("@(#)$File: cdf.c,v 1.118 2021/09/17 17:42:14 christos Exp $")
#endif
#include <assert.h>
@@ -1091,8 +1091,9 @@ cdf_read_property_info(const cdf_stream_t *sst, const cdf_header_t *h,
DPRINTF(("o=%" SIZE_T_FORMAT "u l=%d(%"
SIZE_T_FORMAT "u), t=%" SIZE_T_FORMAT
- "u s=%s\n", o4, l, CDF_ROUND(l, sizeof(l)),
- left, inp[i].pi_str.s_buf));
+ "u s=%.*s\n", o4, l,
+ CDF_ROUND(l, sizeof(l)),
+ left, (int)l, inp[i].pi_str.s_buf));
if (l & 1)
l++;