]> granicus.if.org Git - php/commitdiff
We shouldn't modify strings in-place (it may be interned strings stored in SHN)
authorDmitry Stogov <dmitry@zend.com>
Wed, 7 May 2014 19:19:28 +0000 (23:19 +0400)
committerDmitry Stogov <dmitry@zend.com>
Wed, 7 May 2014 19:19:28 +0000 (23:19 +0400)
ext/pdo/pdo_dbh.c

index c5b2b9fa1a041440d93c5cfe364684f485771c13..da39634c79cf8b488d9ca3aa8e7ba9638fee50f3 100644 (file)
@@ -208,7 +208,6 @@ static PHP_METHOD(PDO, dbh_constructor)
        zval *options = NULL;
        char alt_dsn[512];
        int call_factory = 1;
-       char tmp;
 
        if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|s!s!a!", &data_source, &data_source_len,
                                &username, &usernamelen, &password, &passwordlen, &options)) {
@@ -256,10 +255,8 @@ static PHP_METHOD(PDO, dbh_constructor)
                }
        }
 
-       tmp = data_source[colon - data_source];
-       data_source[colon - data_source] = '\0';
        driver = pdo_find_driver(data_source, colon - data_source);
-       data_source[colon - data_source] = tmp;
+
        if (!driver) {
                /* NB: don't want to include the data_source in the error message as
                 * it might contain a password */