diff top/maint.mk @ 15316:b62cfb73a10c

maint.mk: test further PATH_MAX issues * top/maint.mk (sc_prohibit_path_max_array): Rename... (sc_prohibit_path_max_allocation): ...and also test alloca. Suggested by Jim Meyering. Signed-off-by: Eric Blake <eblake@redhat.com>
author Eric Blake <eblake@redhat.com>
date Thu, 23 Jun 2011 06:40:38 -0600
parents 94b3a0b47189
children cf58fc92428c
line wrap: on
line diff
--- a/top/maint.mk	Wed Jun 22 15:02:24 2011 -0600
+++ b/top/maint.mk	Thu Jun 23 06:40:38 2011 -0600
@@ -1135,11 +1135,11 @@
 	  $(_sc_search_regexp)
 
 # Even if you use pathmax.h to guarantee that PATH_MAX is defined, it might
-# not be constant.  In general, use PATH_MAX as a limit, not an array
-# allocation bound.
-sc_prohibit_path_max_array:
-	@prohibit='\[PATH''_MAX'					\
-	halt='Avoid arrays of size PATH_MAX'				\
+# not be constant, or might overflow a stack.  In general, use PATH_MAX as
+# a limit, not an array or alloca size.
+sc_prohibit_path_max_allocation:
+	@prohibit='(\balloca *\([^)]*|\[[^]]*)PATH_MAX'			\
+	halt='Avoid stack allocations of size PATH_MAX'			\
 	  $(_sc_search_regexp)
 
 sc_vulnerable_makefile_CVE-2009-4029: