From: Denis Briand Date: Fri, 4 Aug 2017 23:45:23 +0000 (+0200) Subject: Fix SIGSEGV with undefined USER environment variable X-Git-Tag: debian/0.6.1-2~13 X-Git-Url: https://git.deb.at/?a=commitdiff_plain;h=e330def8f39c5268fbbd162f8af32c4292b69d16;p=pkg%2Fabook.git Fix SIGSEGV with undefined USER environment variable --- 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