summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStanley Sufficool <ssufficool@php.net>2013-06-01 00:03:44 -0700
committerStanley Sufficool <ssufficool@php.net>2013-06-01 00:03:44 -0700
commitd9be9e0231277b7baf457f9a59dc7616624f8e2e (patch)
tree252a05025fb10790b94c08a740268e79dd5e42b3
parent3b54de3db008490eeae8fba2e471a41906d1eae5 (diff)
downloadphp-git-d9be9e0231277b7baf457f9a59dc7616624f8e2e.tar.gz
FIX BUG #60512 (the correct way this time)
Last fix just truncated the password. This fixes the message handler per the bug report.
-rw-r--r--ext/pdo_dblib/dblib_driver.c5
-rw-r--r--ext/pdo_dblib/pdo_dblib.c8
2 files changed, 6 insertions, 7 deletions
diff --git a/ext/pdo_dblib/dblib_driver.c b/ext/pdo_dblib/dblib_driver.c
index fb0d6d3a53..9baedbe9d2 100644
--- a/ext/pdo_dblib/dblib_driver.c
+++ b/ext/pdo_dblib/dblib_driver.c
@@ -290,11 +290,6 @@ static int pdo_dblib_handle_factory(pdo_dbh_t *dbh, zval *driver_options TSRMLS_
}
}
- /*
- * FreeTDS will not return FAIL but will segfault on passwords longer than 30 chars
- */
- if(strlen(dbh->password) > 30) dbh->password[30] = 0;
-
if (dbh->password) {
if(FAIL == DBSETLPWD(H->login, dbh->password)) {
goto cleanup;
diff --git a/ext/pdo_dblib/pdo_dblib.c b/ext/pdo_dblib/pdo_dblib.c
index ed79aea20d..bc5d364ed3 100644
--- a/ext/pdo_dblib/pdo_dblib.c
+++ b/ext/pdo_dblib/pdo_dblib.c
@@ -93,8 +93,12 @@ int error_handler(DBPROCESS *dbproc, int severity, int dberr,
char *state = "HY000";
TSRMLS_FETCH();
- einfo = (pdo_dblib_err*)dbgetuserdata(dbproc);
- if (!einfo) einfo = &DBLIB_G(err);
+ if(dbproc) {
+ einfo = (pdo_dblib_err*)dbgetuserdata(dbproc);
+ if (!einfo) einfo = &DBLIB_G(err);
+ } else {
+ einfo = &DBLIB_G(err);
+ }
einfo->severity = severity;
einfo->oserr = oserr;