mirror of
https://github.com/postgres/postgres.git
synced 2025-09-03 15:22:11 +03:00
Fix handling of NULL return value in typarray lookup
Commit 6ebeeae29
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
This commit is contained in:
@@ -5420,7 +5420,10 @@ binary_upgrade_set_type_oids_by_type_oid(Archive *fout,
|
||||
pg_type_oid);
|
||||
|
||||
tinfo = findTypeByOid(pg_type_oid);
|
||||
pg_type_array_oid = tinfo->typarray;
|
||||
if (tinfo)
|
||||
pg_type_array_oid = tinfo->typarray;
|
||||
else
|
||||
pg_type_array_oid = InvalidOid;
|
||||
|
||||
if (!OidIsValid(pg_type_array_oid) && force_array_type)
|
||||
pg_type_array_oid = get_next_possible_free_pg_type_oid(fout, upgrade_query);
|
||||
|
Reference in New Issue
Block a user