Off-by-one error

This commit is contained in:
Willem Toorop 2015-10-06 09:46:59 +02:00
parent e3947d7110
commit 3aca772220
1 changed files with 1 additions and 1 deletions

View File

@ -120,7 +120,7 @@ _json_ptr_keydup(const struct mem_funcs *mf, const char *jptr)
char *first = _json_ptr_first(mf, jptr, NULL, 0);
if (first == jptr || first == jptr + 1) {
size_t sz = strlen(jptr);
size_t sz = strlen(jptr) + 1;
if ((first = GETDNS_XMALLOC(*mf, char, sz)))
memcpy(first, jptr, sz);