com php-src: Merge branch 'PHP-5.4' into PHP-5.5: ext/mysqlnd/mysqlnd.c
| From: | Stanislav Malyshev | Date: | Tue, 07 Jul 2015 17:09:34 +0000 |
| Subject: | com php-src: Merge branch 'PHP-5.4' into PHP-5.5: ext/mysqlnd/mysqlnd.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-87811@lists.php.net to get a copy of this message | ||
Commit: b4b082e63ecab2a81e565fb07aafaaaf67b77f66
Author: Stanislav Malyshev <stas@php.net> Tue, 7 Jul 2015 10:09:34 -0700
Parents: 545eddba93fba7a6cbbe77bcb43dc9d3b2c50282 885edfef0a0eb1016a906d197399f92375a795e4
Branches: PHP-5.5
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=b4b082e63ecab2a81e565fb07aafaaaf67b77f66
Log:
Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
Better fix for bug #69958
update news
Fix bug #69669 (mysqlnd is vulnerable to BACKRONYM)
Fix bug #69923 - Buffer overflow and stack smashing error in phar_fix_filepath
Fix bug #69958 - Segfault in Phar::convertToData on invalid file
Conflicts:
ext/mysqlnd/mysqlnd.c
Bugs:
https://bugs.php.net/69958
https://bugs.php.net/69669
https://bugs.php.net/69923
Changed paths:
MM ext/mysqlnd/mysqlnd.c
Diff:
diff --cc ext/mysqlnd/mysqlnd.c
index 6e64a6b,61daf96..c8563ee
--- a/ext/mysqlnd/mysqlnd.c
+++ b/ext/mysqlnd/mysqlnd.c
@@@ -2454,83 -2427,6 +2454,83 @@@ end
/* }}} */
+/* {{{ connect_attr_item_edtor */
+static void
+connect_attr_item_edtor(void * pDest)
+{
+#ifdef ZTS
+ TSRMLS_FETCH();
+#endif
+ DBG_ENTER("connect_attr_item_edtor");
+ mnd_efree(*(char **) pDest);
+ DBG_VOID_RETURN;
+}
+/* }}} */
+
+
+/* {{{ connect_attr_item_pdtor */
+static void
+connect_attr_item_pdtor(void * pDest)
+{
+#ifdef ZTS
+ TSRMLS_FETCH();
+#endif
+ DBG_ENTER("connect_attr_item_pdtor");
+ mnd_pefree(*(char **) pDest, 1);
+ DBG_VOID_RETURN;
+}
+/* }}} */
+
+
+/* {{{ mysqlnd_conn_data::set_client_option_2d */
+static enum_func_status
+MYSQLND_METHOD(mysqlnd_conn_data, set_client_option_2d)(MYSQLND_CONN_DATA * const conn,
+ enum mysqlnd_option option,
+ const char * const key,
+ const char * const value
+ TSRMLS_DC)
+{
+ size_t this_func = STRUCT_OFFSET(struct st_mysqlnd_conn_data_methods, set_client_option_2d);
+ enum_func_status ret = PASS;
+ DBG_ENTER("mysqlnd_conn_data::set_client_option_2d");
+ DBG_INF_FMT("conn=%llu option=%u", conn->thread_id, option);
+
+ if (PASS != conn->m->local_tx_start(conn, this_func TSRMLS_CC)) {
+ goto end;
+ }
+ switch (option) {
+ case MYSQL_OPT_CONNECT_ATTR_ADD:
+ if (!conn->options->connect_attr) {
+ DBG_INF("Initializing connect_attr hash");
+ conn->options->connect_attr = mnd_pemalloc(sizeof(HashTable), conn->persistent);
+ if (!conn->options->connect_attr) {
+ goto oom;
+ }
+ zend_hash_init(conn->options->connect_attr, 0, NULL, conn->persistent?
connect_attr_item_pdtor:connect_attr_item_edtor, conn->persistent);
+ }
+ DBG_INF_FMT("Adding [%s][%s]", key, value);
+ {
+ const char * copyv = mnd_pestrdup(value, conn->persistent);
+ if (!copyv) {
+ goto oom;
+ }
+ zend_hash_update(conn->options->connect_attr, key, strlen(key), ©v, sizeof(char
*), NULL);
+ }
+ break;
+ default:
+ ret = FAIL;
+ }
+ conn->m->local_tx_end(conn, this_func, ret TSRMLS_CC);
+ DBG_RETURN(ret);
+oom:
+ SET_OOM_ERROR(*conn->error_info);
- conn->m->local_tx_end(conn, this_func, FAIL TSRMLS_CC);
++ conn->m->local_tx_end(conn, this_func, FAIL TSRMLS_CC);
+end:
+ DBG_RETURN(FAIL);
+}
+/* }}} */
+
+
/* {{{ mysqlnd_conn_data::use_result */
static MYSQLND_RES *
MYSQLND_METHOD(mysqlnd_conn_data, use_result)(MYSQLND_CONN_DATA * const conn TSRMLS_DC)