From 4fc931199989617970eee431af17bdc36d39dddd Mon Sep 17 00:00:00 2001 From: Oleg Nesterov Date: Fri, 28 Jun 2013 09:53:53 +1000 Subject: [PATCH] coredump: avoid the uninitialized cn->corename if core_pattern is empty If core_pattern is "" or "|", cn->corename is used uninitialized by filp_open() or call_usermodehelper_exec(). Signed-off-by: Oleg Nesterov Cc: Andi Kleen Cc: Colin Walters Cc: Denys Vlasenko Cc: Jiri Slaby Cc: Lennart Poettering Cc: Lucas De Marchi Cc: Neil Horman Signed-off-by: Andrew Morton --- fs/coredump.c | 1 + 1 file changed, 1 insertion(+) diff --git a/fs/coredump.c b/fs/coredump.c index eefc415c75ce..fb4e2b7ea07b 100644 --- a/fs/coredump.c +++ b/fs/coredump.c @@ -165,6 +165,7 @@ static int format_corename(struct core_name *cn, struct coredump_params *cprm) cn->corename = NULL; if (expand_corename(cn, core_name_size)) return -ENOMEM; + cn->corename[0] = '\0'; if (ispipe) ++pat_ptr; -- 2.39.5