]> git.deb.at Git - pkg/abook.git/blobdiff - debian/patches/859407.diff
Fix SIGSEGV with undefined USER environment variable
[pkg/abook.git] / debian / patches / 859407.diff
diff --git a/debian/patches/859407.diff b/debian/patches/859407.diff
new file mode 100644 (file)
index 0000000..a589cdb
--- /dev/null
@@ -0,0 +1,18 @@
+Author: Denis Briand <debian@denis-briand.fr>
+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)