From: dtucker Date: Tue, 29 Apr 2014 20:36:51 +0000 (+0000) Subject: Don't attempt to append a nul quote char to the filename. Should prevent X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=1e163262bbbae9dc722198c0bb569bbca0fb5ba4;p=openbsd Don't attempt to append a nul quote char to the filename. Should prevent fatal'ing with "el_insertstr failed" when there's a single quote char somewhere in the string. bz#2238, ok markus@ --- diff --git a/usr.bin/ssh/sftp.c b/usr.bin/ssh/sftp.c index 02f336ca58d..b534445932a 100644 --- a/usr.bin/ssh/sftp.c +++ b/usr.bin/ssh/sftp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sftp.c,v 1.161 2014/04/29 19:58:50 dtucker Exp $ */ +/* $OpenBSD: sftp.c,v 1.162 2014/04/29 20:36:51 dtucker Exp $ */ /* * Copyright (c) 2001-2004 Damien Miller * @@ -1890,7 +1890,7 @@ complete_match(EditLine *el, struct sftp_conn *conn, char *remote_path, lf = el_line(el); if (g.gl_matchc == 1) { i = 0; - if (!terminated) + if (!terminated && quote != '\0') ins[i++] = quote; if (*(lf->cursor - 1) != '/' && (lastarg || *(lf->cursor) != ' '))