]> granicus.if.org Git - php/commitdiff
MFH
authorAntony Dovgal <tony2001@php.net>
Thu, 28 Dec 2006 14:26:36 +0000 (14:26 +0000)
committerAntony Dovgal <tony2001@php.net>
Thu, 28 Dec 2006 14:26:36 +0000 (14:26 +0000)
ext/odbc/php_odbc.c

index 0b7cee68e448707f1de2d33dd5f02866cc8dfb51..d92c1b63bb6a5cd8036754aee6a79bc51c1f6339 100644 (file)
@@ -2090,23 +2090,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);
                                 }
                         }
                 }