summaryrefslogtreecommitdiff
path: root/sql-common
diff options
context:
space:
mode:
authorGeorgi Kodinov <Georgi.Kodinov@Oracle.com>2012-06-29 14:04:24 +0300
committerGeorgi Kodinov <Georgi.Kodinov@Oracle.com>2012-06-29 14:04:24 +0300
commitd672a10593756b2252ca8d7340988c2ac6438cb8 (patch)
tree8d6a70d68a684c5a62fe7916444a314a2609c4d2 /sql-common
parent5a496caeb579e4f0253388356863f36a7727f0ae (diff)
downloadmariadb-git-d672a10593756b2252ca8d7340988c2ac6438cb8.tar.gz
Bug #12910665: AUTH-PLUGIN-DATA-LEN NOT TESTED FOR VALIDITY BY THE
CLIENT Added a check for a negative second part of the scramble length.
Diffstat (limited to 'sql-common')
-rw-r--r--sql-common/client.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/sql-common/client.c b/sql-common/client.c
index be24c5e89e4..ef1e3c1b7d4 100644
--- a/sql-common/client.c
+++ b/sql-common/client.c
@@ -3415,6 +3415,12 @@ CLI_MYSQL_REAL_CONNECT(MYSQL *mysql,const char *host, const char *user,
mysql->server_status=uint2korr(end+3);
mysql->server_capabilities|= uint2korr(end+5) << 16;
pkt_scramble_len= end[7];
+ if (pkt_scramble_len < 0)
+ {
+ set_mysql_error(mysql, CR_MALFORMED_PACKET,
+ unknown_sqlstate); /* purecov: inspected */
+ goto error;
+ }
}
end+= 18;