From 37acf2a687a6bb06a7a05f81f16e269f0f9e070b Mon Sep 17 00:00:00 2001 From: Doug Torrance Date: Tue, 19 May 2015 22:31:06 -0500 Subject: [PATCH] wmppp.app: Fix segfault when HOME undefined. Instead, we exit with an error message. This fixes Debian bug #716472 [1]. [1] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=716472 --- wmppp.app/wmppp.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/wmppp.app/wmppp.c b/wmppp.app/wmppp.c index 43fb696..7758eee 100644 --- a/wmppp.app/wmppp.c +++ b/wmppp.app/wmppp.c @@ -422,6 +422,11 @@ void wmppp_routine(int argc, char **argv) { parse_rcfile(temp, wmppp_keys); p = getenv("HOME"); + if (p == NULL) { + fprintf(stderr, + "error: HOME environment variable not defined\n"); + exit(EXIT_FAILURE); + } strcpy(temp, p); strcat(temp, "/.wmppprc"); parse_rcfile(temp, wmppp_keys);