Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commite75feb2

Browse files
committed
Fix off by one error in JSON extract path code.
Bug report by David Wheeler, diagnosis assistance from Tom Lane.
1 parent48a2cd3 commite75feb2

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

‎src/backend/utils/adt/jsonfuncs.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -682,9 +682,13 @@ get_array_start(void *state)
682682
ereport(ERROR,
683683
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
684684
errmsg("cannot extract field from a non-object")));
685-
/* initialize array count for this nesting level */
685+
/*
686+
* initialize array count for this nesting level
687+
* Note: the lex_level seen by array_start is one less than that seen by
688+
* the elements of the array.
689+
*/
686690
if (_state->search_type==JSON_SEARCH_PATH&&
687-
lex_level <=_state->npath)
691+
lex_level<_state->npath)
688692
_state->array_level_index[lex_level]=-1;
689693
}
690694

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp