Ver código fonte

cov 10388: fix check for no mcast address

git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2850 fd59a12c-fef9-0310-b244-a6a79926bd2f
Angus Salkeld 15 anos atrás
pai
commit
0c790c067a
1 arquivos alterados com 6 adições e 1 exclusões
  1. 6 1
      exec/totemconfig.c

+ 6 - 1
exec/totemconfig.c

@@ -421,7 +421,12 @@ int totem_config_validate (
 		/*
 		 * Some error checking of parsed data to make sure its valid
 		 */
-		if ((int *)&totem_config->interfaces[i].mcast_addr.addr == 0) {
+
+		struct totem_ip_address null_addr;
+		memset (&null_addr, 0, sizeof (struct totem_ip_address));
+
+		if (memcmp (&totem_config->interfaces[i].mcast_addr, &null_addr,
+				sizeof (struct totem_ip_address)) == 0) {
 			error_reason = "No multicast address specified";
 			goto parse_error;
 		}