Skip to content

Commit 85837b8

Browse files
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 4af123a commit 85837b8

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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy