Skip to content

Commit cbe4177

Browse files
danielgustafssonpull[bot]
authored andcommitted
Fix handling of NULL return value in typarray lookup
Commit 6ebeeae accidentally omitted testing the return value from findTypeByOid which can return NULL. Fix by adding a check to make sure that we have a pointer to dereference. Author: Ranier Vilela <ranier.vf@gmail.com> Reviewed-by: Nathan Bossart <nathandbossart@gmail.com> Reviewed-by: Daniel Gustafsson <daniel@yesql.se> Discussion: https://postgr.es/m/CAEudQAqfMTH8Ya_J6E-NW_y_JyDFDxtQ4V_g6nY_1=0oDbQqdg@mail.gmail.com
1 parent ca24b6c commit cbe4177

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/bin/pg_dump/pg_dump.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5420,7 +5420,10 @@ binary_upgrade_set_type_oids_by_type_oid(Archive *fout,
54205420
pg_type_oid);
54215421

54225422
tinfo = findTypeByOid(pg_type_oid);
5423-
pg_type_array_oid = tinfo->typarray;
5423+
if (tinfo)
5424+
pg_type_array_oid = tinfo->typarray;
5425+
else
5426+
pg_type_array_oid = InvalidOid;
54245427

54255428
if (!OidIsValid(pg_type_array_oid) && force_array_type)
54265429
pg_type_array_oid = get_next_possible_free_pg_type_oid(fout, upgrade_query);

0 commit comments

Comments
 (0)