Content-Length: 258185 | pFad | http://github.com/postgrespro/postgres/commit/24688f4e5a7d5fadde0e43a5b123432d81577d82

A1 Fix minor thinko in convertToJsonb(). · postgrespro/postgres@24688f4 · GitHub
Skip to content

Commit 24688f4

Browse files
committed
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.
1 parent e39250c commit 24688f4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/backend/utils/adt/jsonb_util.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1377,7 +1377,7 @@ convertToJsonb(JsonbValue *val)
13771377
initStringInfo(&buffer);
13781378

13791379
/* Make room for the varlena header */
1380-
reserveFromBuffer(&buffer, sizeof(VARHDRSZ));
1380+
reserveFromBuffer(&buffer, VARHDRSZ);
13811381

13821382
convertJsonbValue(&buffer, &jentry, val, 0);
13831383

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/postgrespro/postgres/commit/24688f4e5a7d5fadde0e43a5b123432d81577d82

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy