Explorar el Código

While looking at used of LCRSODIR, I saw an unchecked strdup.
That could lead to a NULL dereference.



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

Steven Dake hace 17 años
padre
commit
d038f4c148
Se han modificado 1 ficheros con 1 adiciones y 2 borrados
  1. 1 2
      lcr/lcr_ifact.c

+ 1 - 2
lcr/lcr_ifact.c

@@ -176,8 +176,7 @@ static void defaults_path_build (void)
 	char *res;
 
 	res = getcwd (cwd, sizeof (cwd));
-	if (res != NULL) {
-		path_list[0] = strdup (cwd);
+	if (res != NULL && (path_list[0] = strdup (cwd)) != NULL) {
 		path_list_entries++;
 	}