summaryrefslogtreecommitdiffstats
path: root/jv.c
diff options
context:
space:
mode:
authorDavid Tolnay <dtolnay@gmail.com>2015-06-19 10:33:35 -0700
committerNicolas Williams <nico@cryptonector.com>2015-06-20 16:08:56 -0500
commit4a316fbb5a1119ebb74b271129d563fd284315bc (patch)
tree51fed5c676c00384c34b4fcc49611a19149a8136 /jv.c
parent7811ef1e1746f0963deb960af2c9623fb53c24a5 (diff)
fix errors flagged by clang static analyzer
builtin.c: bug - free of uninitialized jv compile.c: missing assertion jq_test.c: buggy logic / unreachable code jv.c: missing assertion jv_alloc.c: false positive - intentional read of uninitialized memory jv_file.c: dead code
Diffstat (limited to 'jv.c')
-rw-r--r--jv.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/jv.c b/jv.c
index 80e3ac91..4c2d1846 100644
--- a/jv.c
+++ b/jv.c
@@ -473,6 +473,7 @@ static jv jvp_string_copy_replace_bad(const char* data, uint32_t length) {
/* Assumes valid UTF8 */
static jv jvp_string_new(const char* data, uint32_t length) {
+ assert(data);
jvp_string* s = jvp_string_alloc(length);
s->length_hashed = length << 1;
memcpy(s->data, data, length);