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

Commit5d1e5c8

Browse files
committed
Check for BuildIndexValueDescription returning NULL in gist_page_items
Per Coverity. BuildIndexValueDescription() cannot actually return NULL inthis instance, because it only returns NULL if the user doesn't have therequired privileges, and this function can only be used by superuser. Butbetter safe than sorry.
1 parent15251c0 commit5d1e5c8

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

‎contrib/pageinspect/gistfuncs.c

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -247,14 +247,20 @@ gist_page_items(PG_FUNCTION_ARGS)
247247
index_deform_tuple(itup,RelationGetDescr(indexRel),
248248
itup_values,itup_isnull);
249249

250-
key_desc=BuildIndexValueDescription(indexRel,itup_values,itup_isnull);
251-
252250
memset(nulls,0,sizeof(nulls));
253251

254252
values[0]=DatumGetInt16(offset);
255253
values[1]=ItemPointerGetDatum(&itup->t_tid);
256254
values[2]=Int32GetDatum((int)IndexTupleSize(itup));
257-
values[3]=CStringGetTextDatum(key_desc);
255+
256+
key_desc=BuildIndexValueDescription(indexRel,itup_values,itup_isnull);
257+
if (key_desc)
258+
values[3]=CStringGetTextDatum(key_desc);
259+
else
260+
{
261+
values[3]= (Datum)0;
262+
nulls[3]= true;
263+
}
258264

259265
tuplestore_putvalues(tupstore,tupdesc,values,nulls);
260266
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp