maint.mk: test further PATH_MAX issues
authorEric Blake <eblake@redhat.com>
Thu, 23 Jun 2011 12:40:38 +0000 (06:40 -0600)
committerEric Blake <eblake@redhat.com>
Thu, 23 Jun 2011 12:41:03 +0000 (06:41 -0600)
* 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>
ChangeLog
top/maint.mk

index 9648603..9d7a52e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -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]
index 4408a4e..766d9c9 100644 (file)
@@ -1135,11 +1135,11 @@ sc_Wundef_boolean:
          $(_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: