Subject: 2.5.0 and NetBSD segfault

From: Joe Laffey <[email-masked]>
Date: Fri, 9 Jul 1999 21:14:22 -0500 (CDT)

wu-ftpd 2.5.0 segfaults under NetBSD 1.3.2 (gcc 2.7.2.2+myc1) whenever a
users tried to log in with a username NOT in /etc/passwd. The user is
prompted for a password and then the segfault occurs.

I have debugged wu-ftpd and found this bug to be an attempt to access a
member of a NULL passwd struct. I added a check for a non-NULL value and
all works fine.

Below is the diff...

Feel free to contact me if you need more info.

Thank you.

Joe Laffey
LAFFEY Computer Imaging
St. Louis, MO
http://www.laffeycomputer.com/
------------------------------
Your mouse has moved.   Windows NT must be restarted for the change to
take effect.   Reboot now?  [ OK ]

---

From: Joe Laffey <[email-masked]>
Date: Fri, 9 Jul 1999 21:23:55 -0500 (CDT)

> member of a NULL passwd struct. I added a check for a non-NULL value and

(Forgot that part...)

diff ftpd.c.OLD ftpd.c
2406c2406
<        if (skey_haskey(pw->pw_name) == 0 &&
---
>        if (pw != NULL && skey_haskey(pw->pw_name) == 0 &&   /* 1999-7-9 
Added check for NULL pw - [email-masked] */

Joe Laffey
LAFFEY Computer Imaging
St. Louis, MO

---

From: Gregory A Lundberg <[email-masked]>
Date: Sat, 10 Jul 1999 12:03:04 -0400

> > wu-ftpd 2.5.0 segfaults under NetBSD 1.3.2 (gcc 2.7.2.2+myc1) whenever
> > a users tried to log in with a username NOT in /etc/passwd. The user is
> > member of a NULL passwd struct. I added a check for a non-NULL value
> > and all works fine.
> 
> diff ftpd.c.OLD ftpd.c
> 2406c2406
> >        if (pw != NULL && skey_haskey(pw->pw_name) == 0 &&

Thank you.

While most of the development group members participate in the mailing
lists, and will see these reports as a result, the best way to ensure we
see a bug report or feature request and to submit patches for them is
covered in the FAQ.

-- 

Gregory A Lundberg              WU-FTPD Development Group
1441 Elmdale Drive              [email-masked]
Kettering, OH 45409-1615 USA    1-800-809-2195