Lists: | pgsql-bugs |
---|
From: | "Ken Lorber" <keni(at)stacksafe(dot)com> |
---|---|
To: | pgsql-bugs(at)postgresql(dot)org |
Subject: | BUG #3867: PQconnectdb(NULL) cores instead of errors. |
Date: | 2008-01-10 18:27:54 |
Message-ID: | 200801101827.m0AIRsJH094177@wwwmaster.postgresql.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-bugs |
The following bug has been logged online:
Bug reference: 3867
Logged by: Ken Lorber
Email address: keni(at)stacksafe(dot)com
PostgreSQL version: 8.3beta4
Operating system: Mac OSX
Description: PQconnectdb(NULL) cores instead of errors.
Details:
PQconnectdb(NULL) cores in strdup() in interfaces/libpq/fe-connect.c:3091
(conninfo_parse). Throwing an error would be more useful.
To reproduce:
1) configure, make, make install
2) set conninfo = NULL at line 38 of src/test/examples/testlibpq.c
3) make testlibpq
4) ./testlibpq
result should be a core or bus error or similar fatal error
gdb shows:
0x90013413 in strdup ()
(gdb) where
#0 0x90013413 in strdup ()
#1 0x0001cc37 in conninfo_parse ()
#2 0x0001d679 in connectOptions1 ()
#3 0x0001d9a1 in PQconnectStart ()
#4 0x0001d9e4 in PQconnectdb ()
#5 0x00001c2e in main ()
Thanks!
From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
---|---|
To: | "Ken Lorber" <keni(at)stacksafe(dot)com> |
Cc: | pgsql-bugs(at)postgresql(dot)org |
Subject: | Re: BUG #3867: PQconnectdb(NULL) cores instead of errors. |
Date: | 2008-01-10 19:21:07 |
Message-ID: | 9629.1199992867@sss.pgh.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-bugs |
"Ken Lorber" <keni(at)stacksafe(dot)com> writes:
> PQconnectdb(NULL) cores in strdup() in interfaces/libpq/fe-connect.c:3091
> (conninfo_parse). Throwing an error would be more useful.
99% of library routines will core if you pass them a null for an
argument that that's not specifically documented to be allowed for.
If you're expecting otherwise, you should adjust your expectations.
regards, tom lane