Content-Length: 262188 | pFad | http://github.com/postgrespro/postgres/commit/870ad6a59bbbd95c2dc3cfe67b07d0e079599edf

74 Fix not-quite-right string comparison in parse_jsonb_index_flags(). · postgrespro/postgres@870ad6a · GitHub
Skip to content

Commit 870ad6a

Browse files
committed
Fix not-quite-right string comparison in parse_jsonb_index_flags().
This code would accept "strinX", where X is any 1-byte character, as meaning "string". Clearly it wasn't meant to do that. No back-patch, since this doesn't affect correct queries and there's some tiny chance we'd break somebody's incorrect query in a minor release. Report and patch by Dominik Czarnota. Discussion: https://postgr.es/m/CABEVAa1dU0mDCAfaT8WF2adVXTDsLVJy_izotg6ze_hh-cn8qQ@mail.gmail.com
1 parent 74b35eb commit 870ad6a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/backend/utils/adt/jsonfuncs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5125,7 +5125,7 @@ parse_jsonb_index_flags(Jsonb *jb)
51255125
pg_strncasecmp(v.val.string.val, "key", 3) == 0)
51265126
flags |= jtiKey;
51275127
else if (v.val.string.len == 6 &&
5128-
pg_strncasecmp(v.val.string.val, "string", 5) == 0)
5128+
pg_strncasecmp(v.val.string.val, "string", 6) == 0)
51295129
flags |= jtiString;
51305130
else if (v.val.string.len == 7 &&
51315131
pg_strncasecmp(v.val.string.val, "numeric", 7) == 0)

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/870ad6a59bbbd95c2dc3cfe67b07d0e079599edf

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy