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

Commit5f95521

Browse files
committed
Fix unsafe use of strtol() on a non-null-terminated Text datum.
jsonb_set() could produce wrong answers or incorrect error reports, or inthe worst case even crash, when trying to convert a path-array element intoan integer for use as an array subscript. Per report from Vitaly Burovoy.Back-patch to 9.5 where the faulty code was introduced (in commitc694701).Michael Paquier
1 parent147112d commit5f95521

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
@@ -3873,7 +3873,7 @@ setPathArray(JsonbIterator **it, Datum *path_elems, bool *path_nulls,
38733873
/* pick correct index */
38743874
if (level<path_len&& !path_nulls[level])
38753875
{
3876-
char*c=VARDATA_ANY(path_elems[level]);
3876+
char*c=TextDatumGetCString(path_elems[level]);
38773877
longlindex;
38783878

38793879
errno=0;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp