Skip to content

Commit

Permalink
Fix bug #81719: mysqlnd/pdo password buffer overflow
Browse files Browse the repository at this point in the history
  • Loading branch information
smalyshev authored and ramsey committed Jun 7, 2022
1 parent 5ed5954 commit 8493e27
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ext/mysqlnd/mysqlnd_wireprotocol.c
Original file line number Diff line number Diff line change
Expand Up @@ -776,7 +776,8 @@ php_mysqlnd_change_auth_response_write(MYSQLND_CONN_DATA * conn, void * _packet)
MYSQLND_VIO * vio = conn->vio;
MYSQLND_STATS * stats = conn->stats;
MYSQLND_CONNECTION_STATE * connection_state = &conn->state;
zend_uchar * const buffer = pfc->cmd_buffer.length >= packet->auth_data_len? pfc->cmd_buffer.buffer : mnd_emalloc(packet->auth_data_len);
size_t total_packet_size = packet->auth_data_len + MYSQLND_HEADER_SIZE;
zend_uchar * const buffer = pfc->cmd_buffer.length >= total_packet_size? pfc->cmd_buffer.buffer : mnd_emalloc(total_packet_size);
zend_uchar * p = buffer + MYSQLND_HEADER_SIZE; /* start after the header */

DBG_ENTER("php_mysqlnd_change_auth_response_write");
Expand Down

0 comments on commit 8493e27

Please sign in to comment.