diff options
author | Nicolas Williams <nico@cryptonector.com> | 2015-06-22 18:32:28 -0500 |
---|---|---|
committer | Nicolas Williams <nico@cryptonector.com> | 2015-06-22 18:32:28 -0500 |
commit | 10cbb9b5806cd3d9b01953bab47ede31fbfda671 (patch) | |
tree | bee0e48729102a8a8a6ef13af711882954b8c6ce /jv.c | |
parent | 4a316fbb5a1119ebb74b271129d563fd284315bc (diff) |
Fix test failure introduced by previous commit
Diffstat (limited to 'jv.c')
-rw-r--r-- | jv.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -473,10 +473,10 @@ 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); + if (data != NULL) + memcpy(s->data, data, length); s->data[length] = 0; jv r = {JV_KIND_STRING, 0, 0, 0, {&s->refcnt}}; return r; |