Skip to content

Commit 1871b04

Browse files
committed
trick clang analyzer (dereference of NULL pointer)
1 parent 115296a commit 1871b04

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/pg_pathman.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,17 @@ make_inh_translation_list(Relation oldrelation, Relation newrelation,
239239
for (new_attno = 0; new_attno < newnatts; new_attno++)
240240
{
241241
att = new_tupdesc->attrs[new_attno];
242+
243+
/*
244+
* Make clang analyzer happy:
245+
*
246+
* Access to field 'attisdropped' results
247+
* in a dereference of a null pointer
248+
*/
249+
if (!att)
250+
elog(ERROR, "error in function "
251+
CppAsString(make_inh_translation_list));
252+
242253
if (!att->attisdropped && att->attinhcount != 0 &&
243254
strcmp(attname, NameStr(att->attname)) == 0)
244255
break;

0 commit comments

Comments
 (0)