From aac06ad691ccd1a91d9230338e86acbb9d218130 Mon Sep 17 00:00:00 2001 From: Oleg Nesterov Date: Wed, 19 Jun 2013 10:08:20 +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 5968064ecfa8..72f816d6cad9 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