Permalink
Browse files

Fix crash bug -- trap NULL msg pointer passed to throw_pg_notice(and …

…error)
  • Loading branch information...
1 parent b63fdb4 commit 850536f731ed010f01e4c53a17a8d38f4be3f47e postgres committed Feb 28, 2003
Showing with 8 additions and 2 deletions.
  1. +8 −2 pg_rsupport.c
View
@@ -52,13 +52,19 @@ typedef struct saved_plan_desc
void
throw_pg_notice(const char **msg)
{
- elog(NOTICE, "%s", *msg);
+ if (msg && *msg)
+ elog(NOTICE, "%s", *msg);
+ else
+ elog(NOTICE, "%s", "");
}
void
throw_pg_error(const char **msg)
{
- elog(ERROR, "%s", *msg);
+ if (msg && *msg)
+ elog(ERROR, "%s", *msg);
+ else
+ elog(ERROR, "%s", "");
}
/*

0 comments on commit 850536f

Please sign in to comment.