Переглянути джерело

Handle NULL ver string in service

In case user not enter ver: in service section, whole
corosync falled with segfaul, because atoi was called
on NULL.

Now, in case of NULL, we rather not use atoi, and
return 0 directly.


git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2370 fd59a12c-fef9-0310-b244-a6a79926bd2f
Jan Friesse 16 роки тому
батько
коміт
a1db33fc99
1 змінених файлів з 1 додано та 1 видалено
  1. 1 1
      exec/service.c

+ 1 - 1
exec/service.c

@@ -405,7 +405,7 @@ unsigned int corosync_service_defaults_link_and_init (struct corosync_api_v1 *co
 			(void *)&found_service_ver,
 			NULL);
 
-		found_service_ver_atoi = atoi (found_service_ver);
+		found_service_ver_atoi = (found_service_ver ? atoi (found_service_ver) : 0);
 
 		corosync_service_link_and_init (
 			corosync_api,