diff options
author | tnurnberg@mysql.com/white.intern.koehntopp.de <> | 2007-11-27 18:24:24 +0100 |
---|---|---|
committer | tnurnberg@mysql.com/white.intern.koehntopp.de <> | 2007-11-27 18:24:24 +0100 |
commit | 46ee271e8fce4d42b999890477f3590b47a3038d (patch) | |
tree | d0bc328d66d11495bd78a8407e6acc38d17454a6 /sql/protocol.cc | |
parent | c6f65c8b4882ba9faf56e4172e5fa66d62c9a2d8 (diff) | |
download | mariadb-git-46ee271e8fce4d42b999890477f3590b47a3038d.tar.gz |
Bug#32707: misdimensioned buffer in protocol layer
Miscalculation in protocol-layer: size buffer correctly so
even really long error messages cannot overflow our buffer.
Diffstat (limited to 'sql/protocol.cc')
-rw-r--r-- | sql/protocol.cc | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/sql/protocol.cc b/sql/protocol.cc index 7c7dfaf7bef..f7a34fde94a 100644 --- a/sql/protocol.cc +++ b/sql/protocol.cc @@ -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; |