Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 01 Nov 2000 01:21:27 +0000
From:      Brian Somers <brian@Awfulhak.org>
To:        "Jacques A. Vidrine" <n@nectar.com>
Cc:        brian@FreeBSD.org, freebsd-bugs@FreeBSD.org, kris@FreeBSD.org, brian@Awfulhak.org
Subject:   Re: bin/22307: ssh dumps core if fields in password entry are empty 
Message-ID:  <200011010121.eA11LRs66500@hak.lan.Awfulhak.org>
In-Reply-To: Message from "Jacques A. Vidrine" <n@nectar.com>  of "Tue, 31 Oct 2000 19:11:08 CST." <20001031191108.C5333@spawn.nectar.com> 

next in thread | previous in thread | raw e-mail | index | archive | help
> On Tue, Oct 31, 2000 at 04:12:06PM -0800, brian@FreeBSD.org wrote:
> > Synopsis: ssh dumps core if fields in password entry are empty
> > 
> > Responsible-Changed-From-To: freebsd-bugs->kris
> > Responsible-Changed-By: brian
> > Responsible-Changed-When: Tue Oct 31 16:08:25 PST 2000
> > Responsible-Changed-Why: 
> > I submitted a patch to kris a while ago for this....
> > 
> > http://www.freebsd.org/cgi/query-pr.cgi?pr=22307
> 
> I think I fixed this with rev. 1.56 of src/lib/libc/gen/getpwent.c.
> 
> Though applications should check if pointers are NULL before
> dereferencing, it appears that many do not when it comes to getpw*
> results.

Yep, that fixes the core-dump - thanks.  The only thing that remains 
to be fixed is the memory leak... :-)  Kris, will you do the honours 
(am I allowed change the PR subject and bug ???!?!).

Something like this should do:

Index: ssh.c
===================================================================
RCS file: /home/ncvs/src/crypto/openssh/ssh.c,v
retrieving revision 1.10
diff -u -r1.10 ssh.c
--- ssh.c	2000/09/10 09:35:38	1.10
+++ ssh.c	2000/11/01 01:19:35
@@ -513,7 +513,6 @@
 	pwcopy.pw_passwd = xstrdup(pw->pw_passwd);
 	pwcopy.pw_uid = pw->pw_uid;
 	pwcopy.pw_gid = pw->pw_gid;
-	pwcopy.pw_class = xstrdup(pw->pw_class);
 	pwcopy.pw_dir = xstrdup(pw->pw_dir);
 	pwcopy.pw_shell = xstrdup(pw->pw_shell);
 	pwcopy.pw_class = xstrdup(pw->pw_class);

> -- 
> Jacques Vidrine / n@nectar.com / jvidrine@verio.net / nectar@FreeBSD.org

Cheers.

-- 
Brian <brian@Awfulhak.org>                        <brian@[uk.]FreeBSD.org>
      <http://www.Awfulhak.org>;                   <brian@[uk.]OpenBSD.org>
Don't _EVER_ lose your sense of humour !




To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200011010121.eA11LRs66500>