Segmentation fault of psql unset - Mailing list pgsql-patches

From sugita@sra.co.jp
Subject Segmentation fault of psql unset
Date
Msg-id 20020118.151114.104033869.sugita@sra.co.jp
Whole thread Raw
Responses Re: Segmentation fault of psql unset  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-patches
Attached is a patch for following fault.

    $ psql
    test=# \unset
    \unset: missing required argument
    Segmentation fault
    $
Index: command.c
===================================================================
RCS file: /projects/cvsroot/pgsql/src/bin/psql/command.c,v
retrieving revision 1.63
diff -u -3 -p -r1.63 command.c
--- command.c    2001/11/05 17:46:30    1.63
+++ command.c    2001/12/02 12:30:45
@@ -709,8 +709,7 @@ exec_command(const char *cmd,
         {
             psql_error("\\%s: missing required argument\n", cmd);
             success = false;
-        }
-        if (!SetVariable(pset.vars, opt, NULL))
+        } else if (!SetVariable(pset.vars, opt, NULL))
         {
             psql_error("\\%s: error\n", cmd);
             success = false;

pgsql-patches by date:

Previous
From: Elliot Lee
Date:
Subject: Re: postgresql-7.2b3-betterquote.patch
Next
From: Tom Lane
Date:
Subject: Re: Segmentation fault of psql unset