From 4d5b79600a86a6c44aa67db479fc63875958458a Mon Sep 17 00:00:00 2001 From: David Levine Date: Tue, 20 Dec 2016 11:48:27 -0500 Subject: [PATCH] Protect repl -file against dereference of null mp. --- uip/repl.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/uip/repl.c b/uip/repl.c index f97210c2..7f0c7bac 100644 --- a/uip/repl.c +++ b/uip/repl.c @@ -452,14 +452,16 @@ try_it_again: fclose (in); { - char *filename = concat (mp->foldpath, "/", msg, NULL); + char *filename = file ? file : concat (mp->foldpath, "/", msg, NULL); for (n = 0; n < svector_size (convert_types); ++n) { add_convert_header (svector_at (convert_types, n), svector_at (convert_args, n), filename, drft); } - free (filename); + if (! file) { + free (filename); + } } if (nwhat) -- 2.56.0