From 6405534814f04899890a2d932db9a4985fd772fe Mon Sep 17 00:00:00 2001 From: Paul Smith Date: Sun, 26 Feb 2012 21:34:51 +0000 Subject: Check for possible buffer overflow on very long filenames. Fixes Savannah bug #35525 --- implicit.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'implicit.c') diff --git a/implicit.c b/implicit.c index 96c7b2b..c5f7481 100644 --- 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)); -- cgit v1.2.3