From: Bruce Momjian Date: Mon, 25 Nov 1996 03:03:48 +0000 (+0000) Subject: Prevent empty queries from crashing server. X-Git-Tag: REL2_0~62 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6c2925b88485f2d2d6aa13191ca25fec725bb601;p=postgresql Prevent empty queries from crashing server. --- diff --git a/src/backend/parser/parser.c b/src/backend/parser/parser.c index 89bd5b56a7..79bac80c11 100644 --- a/src/backend/parser/parser.c +++ b/src/backend/parser/parser.c @@ -6,7 +6,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/parser/parser.c,v 1.11 1996/11/13 20:49:07 scrappy Exp $ + * $Header: /cvsroot/pgsql/src/backend/parser/parser.c,v 1.12 1996/11/25 03:03:48 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -69,10 +69,8 @@ parser(char *str, Oid *typev, int nargs) init_io(); /* Set things up to read from the string, if there is one */ - if (strlen(str) != 0) { - parseString = (char *) palloc(strlen(str) + 1); - memmove(parseString,str,strlen(str)+1); - } + parseString = (char *) palloc(strlen(str) + 1); + memmove(parseString,str,strlen(str)+1); parser_init(typev, nargs); yyresult = yyparse();