From d7be70d0524abbc37861af61a75f576d7f82d93b Mon Sep 17 00:00:00 2001 From: Damien Miller Date: Thu, 22 Sep 2011 21:43:06 +1000 Subject: - djm@cvs.openbsd.org 2011/09/22 06:29:03 [sftp.c] don't let remote_glob() implicitly sort its results in do_globbed_ls() - in all likelihood, they will be resorted anyway --- sftp.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'sftp.c') diff --git a/sftp.c b/sftp.c index ab667f5a5..5c03f89d7 100644 --- a/sftp.c +++ b/sftp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sftp.c,v 1.132 2010/12/04 00:18:01 djm Exp $ */ +/* $OpenBSD: sftp.c,v 1.133 2011/09/22 06:29:03 djm Exp $ */ /* * Copyright (c) 2001-2004 Damien Miller * @@ -793,7 +793,8 @@ do_globbed_ls(struct sftp_conn *conn, char *path, char *strip_path, memset(&g, 0, sizeof(g)); if (remote_glob(conn, path, - GLOB_MARK|GLOB_NOCHECK|GLOB_BRACE|GLOB_KEEPSTAT, NULL, &g) || + GLOB_MARK|GLOB_NOCHECK|GLOB_BRACE|GLOB_KEEPSTAT|GLOB_NOSORT, + NULL, &g) || (g.gl_pathc && !g.gl_matchc)) { if (g.gl_pathc) globfree(&g); -- cgit v1.2.3 From 47d8115e5347385d55b4a17b026bd131793b9e95 Mon Sep 17 00:00:00 2001 From: Damien Miller Date: Fri, 25 Nov 2011 13:53:48 +1100 Subject: - oga@cvs.openbsd.org 2011/11/16 12:24:28 [sftp.c] Don't leak list in complete_cmd_parse if there are no commands found. Discovered when I was ``borrowing'' this code for something else. ok djm@ --- ChangeLog | 8 ++++++++ sftp.c | 6 ++++-- 2 files changed, 12 insertions(+), 2 deletions(-) (limited to 'sftp.c') diff --git a/ChangeLog b/ChangeLog index d55a397bf..760772d59 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +20111125 + - OpenBSD CVS Sync + - oga@cvs.openbsd.org 2011/11/16 12:24:28 + [sftp.c] + Don't leak list in complete_cmd_parse if there are no commands found. + Discovered when I was ``borrowing'' this code for something else. + ok djm@ + 20111121 - (dtucker) [configure.ac] Set _FORTIFY_SOURCE. ok djm@ diff --git a/sftp.c b/sftp.c index 5c03f89d7..da7fbab38 100644 --- a/sftp.c +++ b/sftp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sftp.c,v 1.133 2011/09/22 06:29:03 djm Exp $ */ +/* $OpenBSD: sftp.c,v 1.134 2011/11/16 12:24:28 oga Exp $ */ /* * Copyright (c) 2001-2004 Damien Miller * @@ -1631,8 +1631,10 @@ complete_cmd_parse(EditLine *el, char *cmd, int lastarg, char quote, } list[count] = NULL; - if (count == 0) + if (count == 0) { + xfree(list); return 0; + } /* Complete ambigious command */ tmp = complete_ambiguous(cmd, list, count); -- cgit v1.2.3