From: Antony Dovgal Date: Thu, 28 Dec 2006 14:26:30 +0000 (+0000) Subject: use strlcat() X-Git-Tag: RELEASE_1_0_0RC1~470 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0958fdb46e9d6190bfd52ce5d4439086d38e0184;p=php use strlcat() --- diff --git a/ext/odbc/php_odbc.c b/ext/odbc/php_odbc.c index 41a36e8098..f4aa055f24 100644 --- a/ext/odbc/php_odbc.c +++ b/ext/odbc/php_odbc.c @@ -2083,23 +2083,23 @@ int odbc_sqlconnect(odbc_connection **conn, char *db, char *uid, char *pwd, int if (strstr(db, "pwd") || strstr(db, "PWD")) { pwd = NULL; } - strncpy( lpszConnStr, db, CONNSTRSIZE); + strlcpy( lpszConnStr, db, CONNSTRSIZE); } else { strcpy(lpszConnStr, "DSN="); - strcat(lpszConnStr, db); + strlcat(lpszConnStr, db, CONNSTRSIZE); } if (uid) { if (uid[0]) { - strcat(lpszConnStr, ";UID="); - strcat(lpszConnStr, uid); - strcat(lpszConnStr, ";"); + strlcat(lpszConnStr, ";UID=", CONNSTRSIZE); + strlcat(lpszConnStr, uid, CONNSTRSIZE); + strlcat(lpszConnStr, ";", CONNSTRSIZE); } if (pwd) { if (pwd[0]) { - strcat(lpszConnStr, "PWD="); - strcat(lpszConnStr, pwd); - strcat(lpszConnStr, ";"); + strlcat(lpszConnStr, "PWD=", CONNSTRSIZE); + strlcat(lpszConnStr, pwd, CONNSTRSIZE); + strlcat(lpszConnStr, ";", CONNSTRSIZE); } } }