libpq crash fix [was: Provide a way to not ask for a password in psql]

Поиск
Список
Период
Сортировка
От Martin Pitt
Тема libpq crash fix [was: Provide a way to not ask for a password in psql]
Дата
Msg-id 20071009143202.GC7103@piware.de
обсуждение исходный текст
Ответ на Provide a way to not ask for a password in psql  (Martin Pitt <martin@piware.de>)
Ответы Re: libpq crash fix [was: Provide a way to not ask for a password in psql]
Список pgsql-bugs
Hi again,

Martin Pitt [2007-10-09 15:56 +0200]:
> (2) PGPASSFILE=/dev/null psql -l
>
>    With /dev/null I get a segfault (I'll probably send a patch for
>    that later).

Ah, it tried to free(pgpassfile) in PasswordFromFile(), but that is a
local stack variable.

Can you please apply this upstream?

Thanks,

Martin

--
Martin Pitt        http://www.piware.de
Ubuntu Developer   http://www.ubuntu.com
Debian Developer   http://www.debian.org
diff -Nur postgresql-8.3/build-tree/postgresql-8.3beta1/src/interfaces/libpq/fe-connect.c
postgresql-8.3.new/build-tree/postgresql-8.3beta1/src/interfaces/libpq/fe-connect.c
--- postgresql-8.3beta1/src/interfaces/libpq/fe-connect.c    2007-07-23 19:52:06.000000000 +0200
+++ postgresql-8.3beta1/src/interfaces/libpq/fe-connect.c    2007-10-09 16:22:41.000000000 +0200
@@ -3723,7 +3723,6 @@
         fprintf(stderr,
         libpq_gettext("WARNING: password file \"%s\" is not a plain file\n"),
                 pgpassfile);
-        free(pgpassfile);
         return NULL;
     }


Вложения

В списке pgsql-bugs по дате отправления:

Предыдущее
От: Martin Pitt
Дата:
Сообщение: Provide a way to not ask for a password in psql
Следующее
От: Magnus Hagander
Дата:
Сообщение: Re: libpq crash fix [was: Provide a way to not ask for a password in psql]