mirror of
https://github.com/php/php-src.git
synced 2025-08-17 14:38:49 +02:00
allow static linkage.
Avoid segv when no username is passed
This commit is contained in:
parent
a536e31fb1
commit
ffd35bb63d
2 changed files with 3 additions and 2 deletions
|
@ -130,7 +130,7 @@ functions required for PDO support.
|
||||||
PHP_EVAL_LIBLINE($PDO_ODBC_LIBS $PDO_ODBC_LFLAGS, [PDO_ODBC_SHARED_LIBADD])
|
PHP_EVAL_LIBLINE($PDO_ODBC_LIBS $PDO_ODBC_LFLAGS, [PDO_ODBC_SHARED_LIBADD])
|
||||||
PHP_SUBST(PDO_ODBC_SHARED_LIBADD)
|
PHP_SUBST(PDO_ODBC_SHARED_LIBADD)
|
||||||
|
|
||||||
PHP_NEW_EXTENSION(pdo_odbc, pdo_odbc.c odbc_driver.c odbc_stmt.c, yes,,-I\$prefix/include/php/ext $PDO_ODBC_INCLUDE)
|
PHP_NEW_EXTENSION(pdo_odbc, pdo_odbc.c odbc_driver.c odbc_stmt.c, $ext_shared,,-I\$prefix/include/php/ext $PDO_ODBC_INCLUDE)
|
||||||
else
|
else
|
||||||
AC_MSG_ERROR(
|
AC_MSG_ERROR(
|
||||||
Unknown ODBC flavour $PHP_PDO_ODBC
|
Unknown ODBC flavour $PHP_PDO_ODBC
|
||||||
|
|
|
@ -334,7 +334,8 @@ static int pdo_odbc_handle_factory(pdo_dbh_t *dbh, zval *driver_options TSRMLS_D
|
||||||
use_direct = 1;
|
use_direct = 1;
|
||||||
|
|
||||||
/* Force UID and PWD to be set in the DSN */
|
/* Force UID and PWD to be set in the DSN */
|
||||||
if (*dbh->username && !strstr(dbh->data_source, "uid") && !strstr(dbh->data_source, "UID")) {
|
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);
|
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);
|
sprintf(dsn, "%s;UID=%s;PWD=%s", dbh->data_source, dbh->username, dbh->password);
|
||||||
pefree((char*)dbh->data_source, dbh->is_persistent);
|
pefree((char*)dbh->data_source, dbh->is_persistent);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue