Bug#32707: misdimensioned buffer in protocol layer

Miscalculation in protocol-layer: size buffer correctly so
even really long error messages cannot overflow our buffer.
parent c6f65c8b
......@@ -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