summaryrefslogtreecommitdiff
path: root/ext/pdo_odbc
diff options
context:
space:
mode:
authorMarcus Boerger <helly@php.net>2007-02-24 02:17:47 +0000
committerMarcus Boerger <helly@php.net>2007-02-24 02:17:47 +0000
commit50ea26760da4e0fcf4980e739e1d0ed520de8d59 (patch)
tree888a32ce58864f5318a7f1072f8526c6a99212f9 /ext/pdo_odbc
parent3e262bd36989898ac01224f0a987e79f44d25b31 (diff)
downloadphp-git-50ea26760da4e0fcf4980e739e1d0ed520de8d59.tar.gz
- Avoid sprintf, even when checked copy'n'paste or changes lead to errors
Diffstat (limited to 'ext/pdo_odbc')
-rwxr-xr-xext/pdo_odbc/odbc_driver.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/ext/pdo_odbc/odbc_driver.c b/ext/pdo_odbc/odbc_driver.c
index 53e5281997..dad21762d4 100755
--- a/ext/pdo_odbc/odbc_driver.c
+++ b/ext/pdo_odbc/odbc_driver.c
@@ -427,8 +427,8 @@ static int pdo_odbc_handle_factory(pdo_dbh_t *dbh, zval *driver_options TSRMLS_D
/* Force UID and PWD to be set in the DSN */
if (dbh->username && *dbh->username && !strstr(dbh->data_source, "uid")
&& !strstr(dbh->data_source, "UID")) {
- char *dsn = pemalloc(strlen(dbh->data_source) + strlen(dbh->username) + strlen(dbh->password) + sizeof(";UID=;PWD="), dbh->is_persistent);
- sprintf(dsn, "%s;UID=%s;PWD=%s", dbh->data_source, dbh->username, dbh->password);
+ char *dsn;
+ spprintf(&dsn, 0, "%s;UID=%s;PWD=%s", dbh->data_source, dbh->username, dbh->password);
pefree((char*)dbh->data_source, dbh->is_persistent);
dbh->data_source = dsn;
}