We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9079145 commit 8f34ae3Copy full SHA for 8f34ae3
json-build.h
@@ -400,7 +400,7 @@ jsonb_key(jsonb *b, char buf[], size_t bufsize, const char key[], size_t len)
400
case JSONB_OBJECT_KEY_OR_CLOSE: {
401
enum jsonbcode ret;
402
BUFFER_COPY_CHAR(b, '"', pos, buf, bufsize);
403
- ret = _jsonb_escape(&pos, buf + b->pos, bufsize, key, len);
+ ret = _jsonb_escape(&pos, buf + b->pos, bufsize - b->pos, key, len);
404
if (ret != JSONB_OK) return ret;
405
BUFFER_COPY(b, "\":", 2, pos, buf, bufsize);
406
STACK_HEAD(b, JSONB_OBJECT_VALUE);
@@ -551,7 +551,7 @@ jsonb_string(
551
return JSONB_ERROR_INPUT;
552
}
553
554
- ret = _jsonb_escape(&pos, buf + b->pos, bufsize, str, len);
+ ret = _jsonb_escape(&pos, buf + b->pos, bufsize - b->pos, str, len);
555
556
557
STACK_HEAD(b, next_state);
0 commit comments