Fixed crash caused by sending single semicolon (;) on admin interface

v2.7_reg_test_4716_single_semicolon
Rahim Kanji 2 years ago
parent 5cc418bb6c
commit 72aefea1ed

@ -3761,12 +3761,20 @@ void admin_session_handler(MySQL_Session *sess, void *_pa, PtrSize_t *pkt) {
if (query_no_space_length) {
// fix bug #925
while (query_no_space[query_no_space_length-1]==';' || query_no_space[query_no_space_length-1]==' ') {
while (query_no_space_length &&
(query_no_space[query_no_space_length-1]==';' || query_no_space[query_no_space_length-1]==' ')) {
query_no_space_length--;
query_no_space[query_no_space_length]=0;
}
}
if (query_no_space_length == 0) {
proxy_warning("Empty query\n");
SPA->send_MySQL_ERR(&sess->client_myds->myprot, (char*)"Empty query");
run_query = false;
goto __run_query;
}
// add global mutex, see bug #1188
pthread_mutex_lock(&pa->sql_query_global_mutex);

Loading…
Cancel
Save