#!/bin/sh /usr/share/dpatch/dpatch-run
## 01-segfault.dpatch by Christoph Berg <myon@debian.org>
##
## DP: Fix segfault when encountering lockfiles from users without passwd entry
## DP: (Closes: #150669)

@DPATCH@

diff -Naur nwall-1.32.orig/src/nwall.c nwall-1.32/src/nwall.c
--- nwall-1.32.orig/src/nwall.c	2001-04-08 20:31:35.000000000 +0000
+++ nwall-1.32/src/nwall.c	2006-08-17 09:56:55.000000000 +0000
@@ -303,7 +303,7 @@
 	 */
 	if(!stat(optoutfile, &optout)) {
 	    pwuid = getpwuid(optout.st_uid);
-	    if(!strcmp(utmpptr->ut_user, pwuid->pw_name)) {
+	    if(pwuid && !strcmp(utmpptr->ut_user, pwuid->pw_name)) {
 		/* usernames match */
 		continue;
 	    }
