Hi, I was in my banana tree when I noticed a segfault with sftp on Fedora 17. It segfaults with autocompletion of a local accentued folder/(file?). Steps to Reproduce: $ mkdir Modèles $ sftp root@localhost sftp> put Mo [press TAB] And it segfaults. Actual results: SEGFAULT Expected results: 'put Modèles' Max
This is most probably a problem with libedit.
Thanks for the bug report, will look at the issue closer on Wednesday hopefully.
This fixes the SIGSEGV in libedit: diff --git a/src/chared.c b/src/chared.c index 0a95913..1b6fa68 100644 --- a/src/chared.c +++ b/src/chared.c @@ -612,7 +612,7 @@ FUN(el,insertstr)(EditLine *el, const Char *s) { size_t len; - if ((len = Strlen(s)) == 0) + if (s == NULL || (len = Strlen(s)) == 0) return -1; if (el->el_line.lastchar + len >= el->el_line.limit) { if (!ch_enlargebufs(el, len)) However, if you want sftp to actually support UTF-8, you need to fix sftp so that complete_match() does not call el_insertstr() with incomplete multibyte sequences.
fixed in libedit-3.0-7.20120601cvs.fc18
upstream commit: http://cvsweb.netbsd.org/bsdweb.cgi/src/lib/libedit/chared.c.diff?r1=1.36&r2=1.37
I am not going to backport the fix for stable Fedora. Running the broken sftp on top of fixed libedit leaves the terminal in an inconsistent state, so the SIGSEGV is actually a better response from user's point of view. This really needs to be fixed in sftp -- I have cloned the bug for openssh: bug #841771