Date: Fri, 18 Jan 2002 01:40:02 -0800 (PST) From: Peter Pentchev <roam@ringlet.net> To: freebsd-bugs@FreeBSD.org Subject: Re: misc/34019: sftp core dumped Message-ID: <200201180940.g0I9e2E33113@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
The following reply was made to PR misc/34019; it has been noted by GNATS.
From: Peter Pentchev <roam@ringlet.net>
To: Eugene Podkopaev <eugene@emetex.ru>
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200201180940.g0I9e2E33113>
