mirror of
https://git.proxmox.com/git/mirror_corosync
synced 2025-10-04 07:57:45 +00:00
totemconfig: improve linknumber checking
Check whether linknumber larger than INTERFACE_MAX and display error if so. Signed-off-by: liangxin1300 <XLiang@suse.com> Reviewed-by: Jan Friesse <jfriesse@redhat.com>
This commit is contained in:
parent
9461f87218
commit
1aaa2467b9
@ -1369,6 +1369,16 @@ static int put_nodelist_members_to_config(struct totem_config *totem_config, icm
|
||||
if (res != 3 || strcmp(tmp_key2, "_addr") != 0) {
|
||||
continue;
|
||||
}
|
||||
if (linknumber >= INTERFACE_MAX) {
|
||||
snprintf (error_string_response, sizeof(error_string_response),
|
||||
"parse error in config: interface ring number %u is bigger than allowed maximum %u\n",
|
||||
linknumber, INTERFACE_MAX - 1);
|
||||
*error_string = error_string_response;
|
||||
|
||||
icmap_iter_finalize(iter2);
|
||||
icmap_iter_finalize(iter);
|
||||
return (-1);
|
||||
}
|
||||
|
||||
if (icmap_get_string_r(map, iter_key2, &node_addr_str) != CS_OK) {
|
||||
continue;
|
||||
|
Loading…
Reference in New Issue
Block a user