mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Bug#30671
"ALTER SERVER can cause server to crash" While retrieving values, it would erronously set the socket value to NULL and attempt to use it in strcmp(). Ensure it is correctly set to "" so that strcmp may not crash.
This commit is contained in:
@ -289,7 +289,7 @@ get_server_from_table_to_cache(TABLE *table)
|
||||
{
|
||||
/* alloc a server struct */
|
||||
char *ptr;
|
||||
char *blank= (char*)"";
|
||||
char * const blank= (char*)"";
|
||||
FOREIGN_SERVER *server= (FOREIGN_SERVER *)alloc_root(&mem,
|
||||
sizeof(FOREIGN_SERVER));
|
||||
DBUG_ENTER("get_server_from_table_to_cache");
|
||||
@ -312,7 +312,7 @@ get_server_from_table_to_cache(TABLE *table)
|
||||
server->port= server->sport ? atoi(server->sport) : 0;
|
||||
|
||||
ptr= get_field(&mem, table->field[6]);
|
||||
server->socket= ptr && strlen(ptr) ? ptr : NULL;
|
||||
server->socket= ptr && strlen(ptr) ? ptr : blank;
|
||||
ptr= get_field(&mem, table->field[7]);
|
||||
server->scheme= ptr ? ptr : blank;
|
||||
ptr= get_field(&mem, table->field[8]);
|
||||
|
Reference in New Issue
Block a user