Skip to content

Commit

Permalink
fix(deparse): potential sigsegv (#128)
Browse files Browse the repository at this point in the history
Fix potential sigsegv when passing an invalid protobuf (RawStmt without Stmt) for deparsing.
  • Loading branch information
wesselvdv authored Apr 18, 2022
1 parent a53865a commit 17cf08a
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/pg_query_deparse.c
Original file line number Diff line number Diff line change
Expand Up @@ -2274,6 +2274,9 @@ static void deparseRangeVar(StringInfo str, RangeVar *range_var, DeparseNodeCont

static void deparseRawStmt(StringInfo str, RawStmt *raw_stmt)
{
if (raw_stmt->stmt == NULL)
elog(ERROR, "deparse error in deparseRawStmt: RawStmt with empty Stmt");

deparseStmt(str, raw_stmt->stmt);
}

Expand Down

0 comments on commit 17cf08a

Please sign in to comment.