Commit 418467e3 authored by unknown's avatar unknown

Fix possible memory overrun when reading broken character set files


sql/mysqld.cc:
  Safety fix.
parent 963d57a3
...@@ -85,7 +85,7 @@ static my_bool get_word(struct simpleconfig_buf_st *fb, char *buf) ...@@ -85,7 +85,7 @@ static my_bool get_word(struct simpleconfig_buf_st *fb, char *buf)
endptr = fb->buf; endptr = fb->buf;
} }
while (!isspace(*endptr)) while (*endptr && !isspace(*endptr))
*buf++= *endptr++; *buf++= *endptr++;
*buf=0; *buf=0;
fb->p = endptr; fb->p = endptr;
......
...@@ -785,7 +785,7 @@ void clean_up(bool print_message) ...@@ -785,7 +785,7 @@ void clean_up(bool print_message)
if (!opt_bootstrap) if (!opt_bootstrap)
(void) my_delete(pidfile_name,MYF(0)); // This may not always exist (void) my_delete(pidfile_name,MYF(0)); // This may not always exist
#endif #endif
if (print_message) if (print_message && errmesg)
sql_print_error(ER(ER_SHUTDOWN_COMPLETE),my_progname); sql_print_error(ER(ER_SHUTDOWN_COMPLETE),my_progname);
x_free((gptr) my_errmsg[ERRMAPP]); /* Free messages */ x_free((gptr) my_errmsg[ERRMAPP]); /* Free messages */
my_thread_end(); my_thread_end();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment