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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy