1
0
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:
antony@pcg5ppc.xiphis.org
2007-11-01 12:30:03 -07:00
parent ff184f202f
commit bcfe0fa67e
3 changed files with 24 additions and 4 deletions

View File

@ -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]);