Przeglądaj źródła

defect 1120
The AMF code doesn't detect invalid healthcheck keys and crashes when an
invalid healthcheck key is specified.


git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@946 fd59a12c-fef9-0310-b244-a6a79926bd2f

Steven Dake 20 lat temu
rodzic
commit
10c7243f5c
2 zmienionych plików z 6 dodań i 0 usunięć
  1. 1 0
      exec/amf.c
  2. 5 0
      test/testamf1.c

+ 1 - 0
exec/amf.c

@@ -2483,6 +2483,7 @@ fflush (stdout);
 	healthcheck = find_healthcheck (&req_lib_amf_healthcheckstart->healthcheckKey);
 	if (healthcheck == 0) {
 		error = SA_AIS_ERR_NOT_EXIST;
+		goto error_exit;
 	}
 
 	comp = find_comp (&req_lib_amf_healthcheckstart->compName);

+ 5 - 0
test/testamf1.c

@@ -261,12 +261,17 @@ int main (int argc, char **argv) {
 		&key0,
 		SA_AMF_HEALTHCHECK_AMF_INVOKED,
 		SA_AMF_COMPONENT_FAILOVER);
+	printf ("healthcheck start result %d (should be 1)\n", result);
 
+	/*
+	 * Test already started healthcheck
+	 */
 	result = saAmfHealthcheckStart (handle,
 		&compNameGlobal,
 		&key0,
 		SA_AMF_HEALTHCHECK_AMF_INVOKED,
 		SA_AMF_COMPONENT_FAILOVER);
+	printf ("healthcheck start result %d (should be 14)\n", result);
 
 	result = saAmfComponentRegister (handle, &compNameGlobal, NULL);
 	printf ("register result is %d (should be 1)\n", result);