2012-02-26 Paul Smith * implicit.c (pattern_search): Check the stem length to avoid stack overflows in stem_str. Fixes Savannah bug #35525. --- a/implicit.c +++ b/implicit.c @@ -488,6 +488,13 @@ pattern_search (struct file *file, int archive, dir = pathdir; } + if (stemlen > GET_PATH_MAX) + { + DBS (DB_IMPLICIT, (_("Stem too long: `%.*s'.\n"), + (int) stemlen, stem)); + continue; + } + DBS (DB_IMPLICIT, (_("Trying pattern rule with stem `%.*s'.\n"), (int) stemlen, stem));