Commit dd16453d authored by unknown's avatar unknown

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
parents 91e76870 d857e163
...@@ -118,11 +118,14 @@ void change_rpl_status(RPL_STATUS from_status, RPL_STATUS to_status) ...@@ -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++; \ uint len = (uint)*p++; \
if (p + len > p_end || len >= sizeof(obj)) \ if (p + len > p_end || len >= sizeof(obj)) \
{\
errmsg= msg;\
goto err; \ goto err; \
}\
strmake(obj,(char*) p,len); \ strmake(obj,(char*) p,len); \
p+= len; \ p+= len; \
}\ }\
...@@ -168,6 +171,7 @@ int register_slave(THD* thd, uchar* packet, uint packet_length) ...@@ -168,6 +171,7 @@ int register_slave(THD* thd, uchar* packet, uint packet_length)
int res; int res;
SLAVE_INFO *si; SLAVE_INFO *si;
uchar *p= packet, *p_end= packet + packet_length; 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)) if (check_access(thd, REPL_SLAVE_ACL, any_db,0,0,0,0))
return 1; return 1;
...@@ -176,9 +180,9 @@ int register_slave(THD* thd, uchar* packet, uint packet_length) ...@@ -176,9 +180,9 @@ int register_slave(THD* thd, uchar* packet, uint packet_length)
thd->server_id= si->server_id= uint4korr(p); thd->server_id= si->server_id= uint4korr(p);
p+= 4; p+= 4;
get_object(p,si->host); get_object(p,si->host, "Failed to register slave: too long 'report-host'");
get_object(p,si->user); get_object(p,si->user, "Failed to register slave: too long 'report-user'");
get_object(p,si->password); get_object(p,si->password, "Failed to register slave; too long 'report-password'");
if (p+10 > p_end) if (p+10 > p_end)
goto err; goto err;
si->port= uint2korr(p); si->port= uint2korr(p);
...@@ -197,8 +201,7 @@ int register_slave(THD* thd, uchar* packet, uint packet_length) ...@@ -197,8 +201,7 @@ int register_slave(THD* thd, uchar* packet, uint packet_length)
err: err:
my_free(si, MYF(MY_WME)); my_free(si, MYF(MY_WME));
my_message(ER_UNKNOWN_ERROR, "Wrong parameters to function register_slave", my_message(ER_UNKNOWN_ERROR, errmsg, MYF(0));
MYF(0));
err2: err2:
return 1; return 1;
} }
......
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