提交 24688f4e 编写于 作者: T Tom Lane

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.
上级 e39250c6
......@@ -1377,7 +1377,7 @@ convertToJsonb(JsonbValue *val)
initStringInfo(&buffer);
/* Make room for the varlena header */
reserveFromBuffer(&buffer, sizeof(VARHDRSZ));
reserveFromBuffer(&buffer, VARHDRSZ);
convertJsonbValue(&buffer, &jentry, val, 0);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册