Commit 4ca7b226 authored by Monty's avatar Monty

Safety fix to previous patch

parent bbfb5d7c
...@@ -356,11 +356,11 @@ bool wsrep_cluster_address_check (sys_var *self, THD* thd, set_var* var) ...@@ -356,11 +356,11 @@ bool wsrep_cluster_address_check (sys_var *self, THD* thd, set_var* var)
char addr_buf[FN_REFLEN]; char addr_buf[FN_REFLEN];
if ((! var->save_result.string_value.str) || if ((! var->save_result.string_value.str) ||
(var->save_result.string_value.length > (FN_REFLEN - 1))) // safety (var->save_result.string_value.length >= sizeof(addr_buf))) // safety
goto err; goto err;
strmake(addr_buf, var->save_result.string_value.str, strmake(addr_buf, var->save_result.string_value.str,
sizeof(addr_buf)-1); MY_MIN(sizeof(addr_buf)-1, var->save_result.string_value.length));
if (!wsrep_cluster_address_verify(addr_buf)) if (!wsrep_cluster_address_verify(addr_buf))
return 0; return 0;
......
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