From 478c2dcc839e5f4765e6417684ce414e2d4973a8 Mon Sep 17 00:00:00 2001 From: Eric Blake Date: Thu, 23 Jun 2011 06:40:38 -0600 Subject: [PATCH] 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 --- ChangeLog | 7 +++++++ top/maint.mk | 10 +++++----- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 964860305..9d7a52e32 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2011-06-23 Eric Blake + + 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 maint.mk: add syntax-check to avoid char[PATH_MAX] diff --git a/top/maint.mk b/top/maint.mk index 4408a4e5e..766d9c9c8 100644 --- a/top/maint.mk +++ b/top/maint.mk @@ -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: -- 2.11.0