From: Dan Kalowsky Date: Thu, 19 Apr 2001 19:55:05 +0000 (+0000) Subject: appling patch for joey since he has no ODBC karma. this is for bug #10252 X-Git-Tag: php-4.0.6RC1~364 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d7383e3255c6998bf71a577657f90dc291d3151e;p=php appling patch for joey since he has no ODBC karma. this is for bug #10252 --- diff --git a/ext/odbc/php_odbc.c b/ext/odbc/php_odbc.c index 3c14890ef1..7d62f6587a 100644 --- a/ext/odbc/php_odbc.c +++ b/ext/odbc/php_odbc.c @@ -1929,6 +1929,7 @@ int odbc_sqlconnect(odbc_connection **conn, char *db, char *uid, char *pwd, int char dsnbuf[300]; short dsnbuflen; char *ldb = 0; + int ldb_len = 0; if (strstr((char*)db, ";")) { direct = 1; @@ -1937,8 +1938,9 @@ int odbc_sqlconnect(odbc_connection **conn, char *db, char *uid, char *pwd, int ldb = (char*)emalloc(strlen(db) + strlen(uid) + strlen(pwd) + 12); sprintf(ldb, "%s;UID=%s;PWD=%s", db, uid, pwd); } else { - ldb = (char*)emalloc(strlen(db) + 1); - strcat(ldb, db); + ldb_len = (strlen(db)+1); + ldb = (char*)emalloc(ldb_len); + strlcpy(ldb, db, ldb_len); } }