]> git.ipfire.org Git - thirdparty/postgresql.git/commitdiff
Fix uninitialized variable in transformTableLikeClause()
authorDavid Rowley <drowley@postgresql.org>
Tue, 11 Apr 2023 11:01:12 +0000 (23:01 +1200)
committerDavid Rowley <drowley@postgresql.org>
Tue, 11 Apr 2023 11:01:12 +0000 (23:01 +1200)
process_notnull_constraints should be set to false until we discover a NOT
NULL column.

Discovered while running Valgrind.

Discussion: https://postgr.es/m/CAApHDvoMyiZVi1KW5WVdqMRzWsWkD3F7n6QD+BbAO6WTeAWsUQ@mail.gmail.com

src/backend/parser/parse_utilcmd.c

index 15d8f3a1a0b466520a987bc5d5b7fab4e5a46c0e..ea0fe6f81161e134525756048fc4efeafbaecc12 100644 (file)
@@ -1041,7 +1041,7 @@ transformTableLikeClause(CreateStmtContext *cxt, TableLikeClause *table_like_cla
        AclResult       aclresult;
        char       *comment;
        ParseCallbackState pcbstate;
-       bool            process_notnull_constraints;
+       bool            process_notnull_constraints = false;
 
        setup_parser_errposition_callback(&pcbstate, cxt->pstate,
                                                                          table_like_clause->relation->location);