From owner-freebsd-bugs Tue Oct 31 17:26:32 2000 Delivered-To: freebsd-bugs@freebsd.org Received: from Awfulhak.org (tun.AwfulHak.org [194.242.139.173]) by hub.freebsd.org (Postfix) with ESMTP id 2BC7937B4D7; Tue, 31 Oct 2000 17:26:23 -0800 (PST) Received: from hak.lan.Awfulhak.org (root@hak.lan.awfulhak.org [172.16.0.12]) by Awfulhak.org (8.11.0/8.11.0) with ESMTP id eA11Lel92449; Wed, 1 Nov 2000 01:21:40 GMT (envelope-from brian@hak.lan.Awfulhak.org) Received: from hak.lan.Awfulhak.org (brian@localhost [127.0.0.1]) by hak.lan.Awfulhak.org (8.11.1/8.11.1) with ESMTP id eA11LRs66500; Wed, 1 Nov 2000 01:21:27 GMT (envelope-from brian@hak.lan.Awfulhak.org) Message-Id: <200011010121.eA11LRs66500@hak.lan.Awfulhak.org> X-Mailer: exmh version 2.1.1 10/15/1999 To: "Jacques A. Vidrine" 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 In-Reply-To: Message from "Jacques A. Vidrine" of "Tue, 31 Oct 2000 19:11:08 CST." <20001031191108.C5333@spawn.nectar.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Wed, 01 Nov 2000 01:21:27 +0000 From: Brian Somers Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org > 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 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