diff options
author | unknown <svoj@april.(none)> | 2008-01-31 19:24:24 +0400 |
---|---|---|
committer | unknown <svoj@april.(none)> | 2008-01-31 19:24:24 +0400 |
commit | 629b355b4a2bc051e538244410edc1e3d0933a65 (patch) | |
tree | fa531e0aeb843821aa859aa522220f0717a8de95 /sql/repl_failsafe.cc | |
parent | 0f41efedf0db9ef3aa7d99d10d368a728bedeabd (diff) | |
parent | 5177c97ec0e11b65227868d6cf98de3970262340 (diff) | |
download | mariadb-git-629b355b4a2bc051e538244410edc1e3d0933a65.tar.gz |
Merge mysql.com:/home/svoj/devel/mysql/BUG22989/mysql-5.0-engines
into mysql.com:/home/svoj/devel/mysql/BUG22989/mysql-5.1-engines
sql/repl_failsafe.cc:
Auto merged
Diffstat (limited to 'sql/repl_failsafe.cc')
-rw-r--r-- | sql/repl_failsafe.cc | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/sql/repl_failsafe.cc b/sql/repl_failsafe.cc index 589ee8b2605..b4f7ce36ee5 100644 --- a/sql/repl_failsafe.cc +++ b/sql/repl_failsafe.cc @@ -118,11 +118,14 @@ void change_rpl_status(RPL_STATUS from_status, RPL_STATUS to_status) } -#define get_object(p, obj) \ +#define get_object(p, obj, msg) \ {\ uint len = (uint)*p++; \ if (p + len > p_end || len >= sizeof(obj)) \ + {\ + errmsg= msg;\ goto err; \ + }\ strmake(obj,(char*) p,len); \ p+= len; \ }\ @@ -168,6 +171,7 @@ int register_slave(THD* thd, uchar* packet, uint packet_length) int res; SLAVE_INFO *si; uchar *p= packet, *p_end= packet + packet_length; + const char *errmsg= "Wrong parameters to function register_slave"; if (check_access(thd, REPL_SLAVE_ACL, any_db,0,0,0,0)) return 1; @@ -176,9 +180,9 @@ int register_slave(THD* thd, uchar* packet, uint packet_length) thd->server_id= si->server_id= uint4korr(p); p+= 4; - get_object(p,si->host); - get_object(p,si->user); - get_object(p,si->password); + get_object(p,si->host, "Failed to register slave: too long 'report-host'"); + get_object(p,si->user, "Failed to register slave: too long 'report-user'"); + get_object(p,si->password, "Failed to register slave; too long 'report-password'"); if (p+10 > p_end) goto err; si->port= uint2korr(p); @@ -197,8 +201,7 @@ int register_slave(THD* thd, uchar* packet, uint packet_length) err: my_free(si, MYF(MY_WME)); - my_message(ER_UNKNOWN_ERROR, "Wrong parameters to function register_slave", - MYF(0)); + my_message(ER_UNKNOWN_ERROR, errmsg, MYF(0)); err2: return 1; } |