From 0958fdb46e9d6190bfd52ce5d4439086d38e0184 Mon Sep 17 00:00:00 2001 From: Antony Dovgal Date: Thu, 28 Dec 2006 14:26:30 +0000 Subject: [PATCH] use strlcat() --- ext/odbc/php_odbc.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) 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); } } } -- 2.50.1