b25888b419
www: http://www.wxwidgets.org/ from Andrew Dalgleish < openbsd at ajd dot net dot au > many thanks for much persistence!
25 lines
813 B
Plaintext
25 lines
813 B
Plaintext
$OpenBSD: patch-src_iodbc_connect_c,v 1.1.1.1 2004/07/16 21:01:35 todd Exp $
|
|
--- src/iodbc/connect.c.orig Fri Jan 21 00:19:20 2000
|
|
+++ src/iodbc/connect.c Tue Apr 29 17:56:57 2003
|
|
@@ -841,18 +841,15 @@ SQLDriverConnect (
|
|
dsn = "default";
|
|
}
|
|
|
|
- if (cbConnStrIn > sizeof (cnstr2drv)
|
|
- - STRLEN (dsn) - STRLEN ("DSN=;") - 1)
|
|
+ if (snprintf ((char*)cnstr2drv, sizeof(cnstr2drv), "DSN=%s;%s", dsn, szConnStrIn) >= sizeof(cnstr2drv)) {
|
|
{
|
|
sqlstat = en_S1001; /* a lazy way to avoid
|
|
* using heap memory */
|
|
break;
|
|
}
|
|
|
|
- sprintf ((char*)cnstr2drv, "DSN=%s;", dsn);
|
|
- cbConnStrIn += STRLEN (cnstr2drv);
|
|
- STRNCAT (cnstr2drv, szConnStrIn, cbConnStrIn);
|
|
szConnStrIn = cnstr2drv;
|
|
+ cbConnStrIn = STRLEN (szConnStrIn);
|
|
break;
|
|
|
|
default:
|