Fix minor thinko in convertToJsonb().
The amount of space to reserve for the value's varlena header is VARHDRSZ, not sizeof(VARHDRSZ). The latter coding accidentally failed to fail because of the way the VARHDRSZ macro is currently defined; but if we ever change it to return size_t (as one might reasonably expect it to do), convertToJsonb() would have failed. Spotted by Mark Dilger.
This commit is contained in:
parent
eadd80c08d
commit
49b60a4be7
@ -1377,7 +1377,7 @@ convertToJsonb(JsonbValue *val)
|
|||||||
initStringInfo(&buffer);
|
initStringInfo(&buffer);
|
||||||
|
|
||||||
/* Make room for the varlena header */
|
/* Make room for the varlena header */
|
||||||
reserveFromBuffer(&buffer, sizeof(VARHDRSZ));
|
reserveFromBuffer(&buffer, VARHDRSZ);
|
||||||
|
|
||||||
convertJsonbValue(&buffer, &jentry, val, 0);
|
convertJsonbValue(&buffer, &jentry, val, 0);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user