Commit cace6c96 authored by unknown's avatar unknown

Bug#32707: misdimensioned buffer in protocol layer

Miscalculation in protocol-layer: size buffer correctly so
even really long error messages cannot overflow our buffer.


sql/protocol.cc:
  size buffer correctly so really long error messages cannot overflow it.
parent 20c72dbe
......@@ -56,7 +56,10 @@ void send_error(THD *thd, uint sql_errno, const char *err)
{
#ifndef EMBEDDED_LIBRARY
uint length;
char buff[MYSQL_ERRMSG_SIZE+2], *pos;
/*
buff[]: sql_errno:2 + ('#':1 + SQLSTATE_LENGTH:5) + MYSQL_ERRMSG_SIZE:512
*/
char buff[2+1+SQLSTATE_LENGTH+MYSQL_ERRMSG_SIZE], *pos;
#endif
const char *orig_err= err;
NET *net= &thd->net;
......
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