Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 8eb3b3d

Browse files
committed
Fix length of keys
1 parent 273abbd commit 8eb3b3d

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

jsonbc.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -744,8 +744,12 @@ jsonbc_decompress(AttributeCompression *ac, const struct varlena *data)
744744

745745
JsonbValue *v = &jbv->val.object.pairs[i].key;
746746
v->val.string.val = &buf[offset];
747-
while (buf[offset++] != '\0');
748-
v->val.string.len = offset - oldoff - 2;
747+
748+
/* move to next key in buffer */
749+
while (buf[offset++] != '\0')
750+
Assert(offset <= buflen);
751+
752+
v->val.string.len = offset - oldoff - 1;
749753
}
750754

751755
/* check correctness */

0 commit comments

Comments
 (0)