changeset 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 dcda54042567
files ChangeLog top/maint.mk
diffstat 2 files changed, 12 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Wed Jun 22 15:02:24 2011 -0600
+++ b/ChangeLog	Thu Jun 23 06:40:38 2011 -0600
@@ -1,3 +1,10 @@
+2011-06-23  Eric Blake  <eblake@redhat.com>
+
+	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.
+
 2011-06-22  Eric Blake  <eblake@redhat.com>
 
 	maint.mk: add syntax-check to avoid char[PATH_MAX]
--- 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: