Skip to content

Commit a65b89f

Browse files
committed
Merge pull request #14 from yiliaofan/master
fix php5.6.9 zend_parse_parameters coredump
2 parents 877d14f + 9c9b143 commit a65b89f

File tree

2 files changed

+12
-8
lines changed

2 files changed

+12
-8
lines changed

connect_pool.c

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -479,9 +479,11 @@ static void pdo_proxy_pdo(zval * args) {
479479
if (EG(exception)) {
480480
zval *str;
481481
CP_SEND_EXCEPTION_ARGS(&str);
482-
char *p = strstr(Z_STRVAL_P(str), "server has gone away");
483-
char *p2 = strstr(Z_STRVAL_P(str), "There is already an active transaction");
484-
if (p || p2) {
482+
483+
char *p = strcasestr(Z_STRVAL_P(str), "server has gone away");
484+
char *p2 = strcasestr(Z_STRVAL_P(str), "There is already an active transaction");
485+
if (p || p2)
486+
{
485487
zend_hash_del(&pdo_object_table, Z_STRVAL_PP(data_source), Z_STRLEN_PP(data_source));
486488
}
487489
zval_ptr_dtor(&str);
@@ -718,9 +720,11 @@ static void redis_dispatch(zval * args) {
718720
if (EG(exception)) {
719721
zval *str;
720722
CP_SEND_EXCEPTION_ARGS(&str);
721-
char *p = strstr(Z_STRVAL_P(str), "server went away");
722-
char *p2 = strstr(Z_STRVAL_P(str), "Connection lost");
723-
if (p || p2) {
723+
724+
char *p = strcasestr(Z_STRVAL_P(str), "server went away");
725+
char *p2 = strcasestr(Z_STRVAL_P(str), "Connection lost");
726+
if (p || p2)
727+
{
724728
zend_hash_del(&redis_object_table, Z_STRVAL_PP(data_source), Z_STRLEN_PP(data_source));
725729
}
726730
zval_ptr_dtor(&str);

connect_pool_client.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,7 @@ PHP_METHOD(pdo_connect_pool, __construct)
342342
long port = CP_PORT_PDO;
343343
zval *options = NULL;
344344

345-
if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|s!s!a!l!", &data_source, &data_source_len,
345+
if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|s!s!a!l", &data_source, &data_source_len,
346346
&username, &usernamelen, &password, &passwordlen, &options, &port)) {
347347
ZVAL_NULL(object);
348348
return;
@@ -678,7 +678,7 @@ PHP_FUNCTION(get_disable_list)
678678
{
679679
zval *conf = NULL;
680680
long port;
681-
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a!l!", &conf, &port) == FAILURE) {
681+
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a!l", &conf, &port) == FAILURE) {
682682
return;
683683
}
684684
if (!ptr_ping_addr) {

0 commit comments

Comments
 (0)