From owner-freebsd-bugs Fri Jan 18 1:40:32 2002 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id 7F69437B404 for ; Fri, 18 Jan 2002 01:40:02 -0800 (PST) Received: (from gnats@localhost) by freefall.freebsd.org (8.11.6/8.11.6) id g0I9e2E33113; Fri, 18 Jan 2002 01:40:02 -0800 (PST) (envelope-from gnats) Date: Fri, 18 Jan 2002 01:40:02 -0800 (PST) Message-Id: <200201180940.g0I9e2E33113@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org Cc: From: Peter Pentchev Subject: Re: misc/34019: sftp core dumped Reply-To: Peter Pentchev Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org The following reply was made to PR misc/34019; it has been noted by GNATS. From: Peter Pentchev To: Eugene Podkopaev Cc: freebsd-gnats-submit@FreeBSD.org Subject: Re: misc/34019: sftp core dumped Date: Fri, 18 Jan 2002 11:37:28 +0200 On Fri, Jan 18, 2002 at 12:56:21AM -0800, Eugene Podkopaev wrote: > > >Number: 34019 > >Category: misc > >Synopsis: sftp core dumped > >Originator: Eugene Podkopaev > >Release: 4.5-PRERELEASE > >Organization: > JSC EMETEX > >Environment: > FreeBSD selena 4.5-PRERELEASE FreeBSD 4.5-PRERELEASE #4: Tue Jan 8 13:07:29 MSK 2002 root@selena:/usr/obj/usr/src/sys/SELENA i386 > >Description: > sftp crashes when I try to upload nonexisting file. > >How-To-Repeat: [snip] > # sftp selena.emetex.ru > Connecting to selena.emetex.ru... > sftp> put nonexisting > Segmentation fault (core dumped) > # Can you try the attached patch? It should work for both -stable and -current with no modifications. After applying the patch, all you need to rebuild is sftp; something like cd /usr/src/secure/usr.bin/sftp && make && sudo make install should do the trick. G'luck, Peter -- I am jealous of the first word in this sentence. Index: src/crypto/openssh/sftp-int.c =================================================================== RCS file: /home/ncvs/src/crypto/openssh/sftp-int.c,v retrieving revision 1.1.1.1.2.1 diff -u -r1.1.1.1.2.1 sftp-int.c --- src/crypto/openssh/sftp-int.c 28 Sep 2001 01:33:34 -0000 1.1.1.1.2.1 +++ src/crypto/openssh/sftp-int.c 18 Jan 2002 09:31:31 -0000 @@ -357,7 +357,8 @@ memset(&g, 0, sizeof(g)); debug3("Looking up %s", abs_src); - if (remote_glob(in, out, abs_src, 0, NULL, &g)) { + if (remote_glob(in, out, abs_src, 0, NULL, &g) != 0 || + g.gl_matchc == 0) { error("File \"%s\" not found.", abs_src); err = -1; goto out; @@ -436,7 +437,7 @@ memset(&g, 0, sizeof(g)); debug3("Looking up %s", src); - if (glob(src, 0, NULL, &g)) { + if (glob(src, 0, NULL, &g) != 0 || g.gl_matchc == 0) { error("File \"%s\" not found.", src); err = -1; goto out; To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message