From e330def8f39c5268fbbd162f8af32c4292b69d16 Mon Sep 17 00:00:00 2001 From: Denis Briand Date: Sat, 5 Aug 2017 01:45:23 +0200 Subject: [PATCH] Fix SIGSEGV with undefined USER environment variable --- debian/changelog | 1 + debian/patches/859407.diff | 18 ++++++++++++++++++ debian/patches/series | 1 + 3 files changed, 20 insertions(+) create mode 100644 debian/patches/859407.diff diff --git a/debian/changelog b/debian/changelog index ac76bcc..d337ce8 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,6 +1,7 @@ abook (0.6.1-2) UNRELEASED; urgency=low * Bump standards version to 4.0.0 + * Fix SIGSEGV with undefined USER environment variable (Closes: #859407). -- Denis Briand Fri, 04 Aug 2017 23:26:23 +0200 diff --git a/debian/patches/859407.diff b/debian/patches/859407.diff new file mode 100644 index 0000000..a589cdb --- /dev/null +++ b/debian/patches/859407.diff @@ -0,0 +1,18 @@ +Author: Denis Briand +Bug-Debian: https://bugs.debian.org/859407 +Description: if USER env variable isn't defined, use nobody account to avoid SIGSEGV with getpwnam + +--- a/filter.c ++++ b/filter.c +@@ -186,6 +186,11 @@ + int rtn; + char *tmp; + ++ //if USER env variable isn't defined, use nobody account to avoid SIGSEGV with getpwnam ++ if (!username) { ++ username = "nobody"; ++ } ++ + pwent = getpwnam(username); + + if((tmp = xstrdup(pwent->pw_gecos)) == NULL) diff --git a/debian/patches/series b/debian/patches/series index c905432..c8c0863 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -1 +1,2 @@ +859407.diff fix_spelling_error_in_binary.diff -- 2.39.2