From: Christoph M. Becker Date: Tue, 20 Aug 2019 11:32:53 +0000 (+0200) Subject: Merge branch 'PHP-7.2' into PHP-7.3 X-Git-Tag: php-7.4.0beta4~4^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3771d661426f33a27590b05df9c8983a2273fab6;p=php Merge branch 'PHP-7.2' into PHP-7.3 * PHP-7.2: fix the problem for connect_attr, set db condition, and add a new attribute _server_host --- 3771d661426f33a27590b05df9c8983a2273fab6 diff --cc NEWS index c07743ed1a,e747a4f8eb..90e32a74f4 --- a/NEWS +++ b/NEWS @@@ -4,14 -4,14 +4,18 @@@ PH - Core: . Fixed bug #78220 (Can't access OneDrive folder). (cmb, ab) - . Fixed bug #78412 (Generator incorrectly reports non-releasable $this as GC - child). (Nikita) + . Fixed bug #77922 (Double release of doc comment on inherited shadow + property). (Nikita) + +- Intl: + . Ensure IDNA2003 rules are used with idn_to_ascii() and idn_to_utf8() + when requested. (Sara) + - MySQLnd: + . Fixed connect_attr issues and added the _server_host connection attribute. + (Qianqian Bu) + -29 Aug 2019, PHP 7.2.22 +29 Aug 2019, PHP 7.3.9 - Core: . Fixed bug #78363 (Buffer overflow in zendparse). (Nikita) diff --cc ext/mysqlnd/mysqlnd_auth.c index e56ea20380,2b23257b73..30ef6639ca --- a/ext/mysqlnd/mysqlnd_auth.c +++ b/ext/mysqlnd/mysqlnd_auth.c @@@ -376,60 -385,67 +376,63 @@@ mysqlnd_auth_change_user(MYSQLND_CONN_D DBG_ENTER("mysqlnd_auth_change_user"); - chg_user_resp = conn->payload_decoder_factory->m.get_change_user_response_packet(conn->payload_decoder_factory, FALSE); - - if (!chg_user_resp) { - SET_OOM_ERROR(conn->error_info); - goto end; - } + conn->payload_decoder_factory->m.init_change_user_response_packet(&chg_user_resp); if (use_full_blown_auth_packet != TRUE) { - change_auth_resp_packet = conn->payload_decoder_factory->m.get_change_auth_response_packet(conn->payload_decoder_factory, FALSE); - if (!change_auth_resp_packet) { - SET_OOM_ERROR(conn->error_info); - goto end; - } + MYSQLND_PACKET_CHANGE_AUTH_RESPONSE change_auth_resp_packet; + + conn->payload_decoder_factory->m.init_change_auth_response_packet(&change_auth_resp_packet); - change_auth_resp_packet->auth_data = auth_plugin_data; - change_auth_resp_packet->auth_data_len = auth_plugin_data_len; + change_auth_resp_packet.auth_data = auth_plugin_data; + change_auth_resp_packet.auth_data_len = auth_plugin_data_len; - if (!PACKET_WRITE(change_auth_resp_packet)) { + if (!PACKET_WRITE(conn, &change_auth_resp_packet)) { SET_CONNECTION_STATE(&conn->state, CONN_QUIT_SENT); SET_CLIENT_ERROR(conn->error_info, CR_SERVER_GONE_ERROR, UNKNOWN_SQLSTATE, mysqlnd_server_gone); + PACKET_FREE(&change_auth_resp_packet); goto end; } + + PACKET_FREE(&change_auth_resp_packet); } else { - auth_packet = conn->payload_decoder_factory->m.get_auth_packet(conn->payload_decoder_factory, FALSE); + MYSQLND_PACKET_AUTH auth_packet; - if (!auth_packet) { - SET_OOM_ERROR(conn->error_info); - goto end; - } + conn->payload_decoder_factory->m.init_auth_packet(&auth_packet); - auth_packet->is_change_user_packet = TRUE; - auth_packet->user = user; - auth_packet->db = db; - auth_packet->db_len = db_len; - auth_packet->silent = silent; + auth_packet.is_change_user_packet = TRUE; + auth_packet.user = user; + auth_packet.db = db; + auth_packet.db_len = db_len; + auth_packet.silent = silent; - auth_packet->auth_data = auth_plugin_data; - auth_packet->auth_data_len = auth_plugin_data_len; - auth_packet->auth_plugin_name = auth_protocol; + auth_packet.auth_data = auth_plugin_data; + auth_packet.auth_data_len = auth_plugin_data_len; + auth_packet.auth_plugin_name = auth_protocol; + if (conn->server_capabilities & CLIENT_CONNECT_ATTRS) { - auth_packet->connect_attr = conn->options->connect_attr; ++ auth_packet.connect_attr = conn->options->connect_attr; + } if (conn->m->get_server_version(conn) >= 50123) { - auth_packet->charset_no = conn->charset->nr; + auth_packet.charset_no = conn->charset->nr; } - if (!PACKET_WRITE(auth_packet)) { + if (!PACKET_WRITE(conn, &auth_packet)) { SET_CONNECTION_STATE(&conn->state, CONN_QUIT_SENT); SET_CLIENT_ERROR(conn->error_info, CR_SERVER_GONE_ERROR, UNKNOWN_SQLSTATE, mysqlnd_server_gone); + PACKET_FREE(&auth_packet); goto end; } + + PACKET_FREE(&auth_packet); } - ret = PACKET_READ(chg_user_resp); - COPY_CLIENT_ERROR(conn->error_info, chg_user_resp->error_info); + ret = PACKET_READ(conn, &chg_user_resp); + COPY_CLIENT_ERROR(conn->error_info, chg_user_resp.error_info); - if (0xFE == chg_user_resp->response_code) { + if (0xFE == chg_user_resp.response_code) { ret = FAIL; - if (!chg_user_resp->new_auth_protocol) { + if (!chg_user_resp.new_auth_protocol) { DBG_ERR(mysqlnd_old_passwd); SET_CLIENT_ERROR(conn->error_info, CR_UNKNOWN_ERROR, UNKNOWN_SQLSTATE, mysqlnd_old_passwd); } else {