com php-src: FIX BUG #60512 (the correct way this time): ext/pdo_dblib/dblib_driver.c ext/pdo_dblib/pdo_dbli b.c
| From: | Stanley Sufficool | Date: | Sat, 01 Jun 2013 07:03:44 +0000 |
| Subject: | com php-src: FIX BUG #60512 (the correct way this time): ext/pdo_dblib/dblib_driver.c ext/pdo_dblib/pdo_dbli b.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-72272@lists.php.net to get a copy of this message | ||
Commit: d9be9e0231277b7baf457f9a59dc7616624f8e2e
Author: Stanley Sufficool <ssufficool@php.net> Sat, 1 Jun 2013 00:03:44 -0700
Parents: 3b54de3db008490eeae8fba2e471a41906d1eae5
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=d9be9e0231277b7baf457f9a59dc7616624f8e2e
Log:
FIX BUG #60512 (the correct way this time)
Last fix just truncated the password. This fixes the message
handler per the bug report.
Bugs:
https://bugs.php.net/60512
Changed paths:
M ext/pdo_dblib/dblib_driver.c
M ext/pdo_dblib/pdo_dblib.c
Diff:
diff --git a/ext/pdo_dblib/dblib_driver.c b/ext/pdo_dblib/dblib_driver.c
index fb0d6d3..9baedbe 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 ed79aea..bc5d364 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;