pg.ddx.io pgsql-odbc@postgresql.org mailing list archive
help / color / mirror / Atom feed[PATCH] Fix crash during connect using SSPI auth
2+ messages / 2 participants
[nested] [flat]
* [PATCH] Fix crash during connect using SSPI auth
@ 2014-06-23 21:02 Nikhil Deshpande <ndeshpande@vmware.com>
2014-06-24 03:35 ` Re: [PATCH] Fix crash during connect using SSPI auth Inoue, Hiroshi <inoue@tpf.co.jp>
0 siblings, 1 reply; 2+ messages in thread
From: Nikhil Deshpande @ 2014-06-23 21:02 UTC (permalink / raw)
To: pgsql-odbc
Hi,
I ran into a crash in psqlodbc driver on Windows while trying to connect
using SSPI authentication (both client and server are on same Windows
host, using a Windows local account instead of domain account, without
any Kerberos setup).
The crash is due to a NULL pointer dereference in function
extract_extra_attribute_setting(), ci->conn_settings.name was
NULL in caller MakePrincHint():
1741 char *extract_extra_attribute_setting(const pgNAME setting, ...
1742 {
1743 const char *str = GET_NAME(setting);
...
1750 for (cptr = str; *cptr; cptr++) <-- *cptr crashes
Please see attached stack trace for more details.
With attached patch, connection using SSPI authentication was
successful.
Thanks,
Nikhil
--
Sent via pgsql-odbc mailing list (pgsql-odbc@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-odbc
Attachments:
stacktrace.txt (text/plain, 1.9K) download
00 psqlodbc35w!extract_extra_attribute_setting(struct pgNAME setting = struct pgNAME, char * attr = 0x00000001`80223bc0 "krbsrvname")+0x9b [e:\git\pg\winbuild\win64\pg\pgodbc\dlg_specific.c @ 1751]
01 psqlodbc35w!MakePrincHint(struct ConnInfo * ci = 0x00000000`01fa6160, int sspi = 0n1)+0x48 [e:\git\pg\winbuild\win64\pg\pgodbc\connection.c @ 1540]
02 psqlodbc35w!original_CC_connect(struct ConnectionClass_ * self = 0x00000000`01fa6080, char password_req = 0n0 '', char * salt_para = 0x00000000`0012ebe4 "")+0x1592 [e:\git\pg\winbuild\win64\pg\pgodbc\connection.c @ 2019]
03 psqlodbc35w!CC_connect(struct ConnectionClass_ * self = 0x00000000`01fa6080, char password_req = 0n0 '', char * salt_para = 0x00000000`0012ebe4 "")+0x17a [e:\git\pg\winbuild\win64\pg\pgodbc\connection.c @ 2165]
04 psqlodbc35w!PGAPI_DriverConnect(void * hdbc = 0x00000000`01fa6080, struct HWND__ * hwnd = 0x00000000`00010010, unsigned char * szConnStrIn = 0x00000000`01fa27d0 "DSN=sspi_dsn_test;", short cbConnStrIn = 0n22, unsigned char * szConnStrOut = 0x00000000`01fa70c0 "???", short cbConnStrOutMax = 0n2048, short * pcbConnStrOut = 0x00000000`0012ecc4, unsigned short fDriverCompletion = 0)+0x3b6 [e:\git\pg\winbuild\win64\pg\pgodbc\drvconn.c @ 229]
05 psqlodbc35w!SQLDriverConnectW(void * hdbc = 0x00000000`01fa6080, struct HWND__ * hwnd = 0x00000000`00010010, unsigned short * szConnStrIn = 0x00000000`003c4660, short cbConnStrIn = 0n-3, unsigned short * szConnStrOut = 0x00000000`0012f6c0, short cbConnStrOutMax = 0n2048, short * pcbConnStrOut = 0x00000000`0012fec0, unsigned short fDriverCompletion = 0)+0x1b6 [e:\git\pg\winbuild\win64\pg\pgodbc\odbcapiw.c @ 143]
06 ODBC32!SQLInternalDriverConnectW+0x53c
07 ODBC32!SQLDriverConnectW+0x1863
08 ODBCClientSample!getConnection(void)+0x17c [e:\git\pg\src\scripts\samples\odbcclientsample.c @ 163]
09 ODBCClientSample!main(int argc = 0n1, char ** argv = 0x00000000`00322d90)+0x12 [e:\git\pg\src\scripts\samples\odbcclientsample.c @ 219]
0001-Fix-crash-during-connect-using-SSPI-auth.patch (text/plain, 1011B) download
From 00882823d9e888701fb8d055f5cb8a3a84f36818 Mon Sep 17 00:00:00 2001
From: Nikhil R Deshpande <ndeshpande@vmware.com>
Date: Mon, 23 Jun 2014 13:33:47 -0700
Subject: [PATCH] Fix crash during connect using SSPI auth
This patch fixes a NULL pointer dereference occurring when connecting
using SSPI authentication (without kerberos, a local Windows user trying
to connect to postgres instance on same host).
---
dlg_specific.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dlg_specific.c b/dlg_specific.c
index 8e051af..54525e3 100644
--- a/dlg_specific.c
+++ b/dlg_specific.c
@@ -1740,7 +1740,7 @@ char *extract_attribute_setting(const char *str, const char *attr, BOOL ref_comm
*/
char *extract_extra_attribute_setting(const pgNAME setting, const char *attr)
{
- const char *str = GET_NAME(setting);
+ const char *str = SAFE_NAME(setting);
const char *cptr, *sptr = NULL;
char *rptr;
BOOL allowed_cmd = FALSE, in_quote = FALSE, in_comment = FALSE;
--
1.8.5.2 (Apple Git-48)
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: [PATCH] Fix crash during connect using SSPI auth
2014-06-23 21:02 [PATCH] Fix crash during connect using SSPI auth Nikhil Deshpande <ndeshpande@vmware.com>
@ 2014-06-24 03:35 ` Inoue, Hiroshi <inoue@tpf.co.jp>
0 siblings, 0 replies; 2+ messages in thread
From: Inoue, Hiroshi @ 2014-06-24 03:35 UTC (permalink / raw)
To: Nikhil Deshpande <ndeshpande@vmware.com>; +Cc: pgsql-odbc
Hi Nikhil,
(2014/06/24 6:02), Nikhil Deshpande wrote:
> Hi,
>
> I ran into a crash in psqlodbc driver on Windows while trying to connect
> using SSPI authentication (both client and server are on same Windows
> host, using a Windows local account instead of domain account, without
> any Kerberos setup).
>
> The crash is due to a NULL pointer dereference in function
> extract_extra_attribute_setting(), ci->conn_settings.name was
> NULL in caller MakePrincHint():
>
> 1741 char *extract_extra_attribute_setting(const pgNAME setting, ...
> 1742 {
> 1743 const char *str = GET_NAME(setting);
> ...
> 1750 for (cptr = str; *cptr; cptr++) <-- *cptr crashes
>
> Please see attached stack trace for more details.
>
>
> With attached patch, connection using SSPI authentication was
> successful.
Applied.
Thanks.
regards,
Hiroshi Inoue
--
I am using the free version of SPAMfighter.
SPAMfighter has removed 11063 of my spam emails to date.
Get the free SPAMfighter here: http://www.spamfighter.com/len
Do you have a slow PC? Try a Free scan
http://www.spamfighter.com/SLOW-PCfighter?cid=sigen
--
Sent via pgsql-odbc mailing list (pgsql-odbc@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-odbc
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2014-06-24 03:35 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2014-06-23 21:02 [PATCH] Fix crash during connect using SSPI auth Nikhil Deshpande <ndeshpande@vmware.com>
2014-06-24 03:35 ` Inoue, Hiroshi <inoue@tpf.co.jp>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox