diff options
author | Kenneth R Westerback <krw@cvs.openbsd.org> | 2016-05-25 15:36:02 +0000 |
---|---|---|
committer | Kenneth R Westerback <krw@cvs.openbsd.org> | 2016-05-25 15:36:02 +0000 |
commit | c1e7e1f3de9cfe6106716fbf965eb99947624508 (patch) | |
tree | d89cc2db2c5055973ed224b046be79cff6bfaa41 /usr.bin | |
parent | 6079d25369f74297c858deb0675a84dcbcae8a85 (diff) |
Avoid a use-after-free.
Diff from Vladimir Sotirov via tech@. Thanks!
ok millert@
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/ftp/cmds.c | 6 | ||||
-rw-r--r-- | usr.bin/ftp/small.c | 6 |
2 files changed, 7 insertions, 5 deletions
diff --git a/usr.bin/ftp/cmds.c b/usr.bin/ftp/cmds.c index 2b3bc72b79c..9fdd8d25655 100644 --- a/usr.bin/ftp/cmds.c +++ b/usr.bin/ftp/cmds.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmds.c,v 1.76 2016/03/17 19:40:43 krw Exp $ */ +/* $OpenBSD: cmds.c,v 1.77 2016/05/25 15:36:01 krw Exp $ */ /* $NetBSD: cmds.c,v 1.27 1997/08/18 10:20:15 lukem Exp $ */ /* @@ -1643,9 +1643,7 @@ void newer(int argc, char *argv[]) { - if (getit(argc, argv, -1, "w")) - fprintf(ttyout, "Local file \"%s\" is newer than remote file \"%s\".\n", - argv[2], argv[1]); + (void)getit(argc, argv, -1, "w"); } /* diff --git a/usr.bin/ftp/small.c b/usr.bin/ftp/small.c index 23f477f565e..a0015a6eff5 100644 --- a/usr.bin/ftp/small.c +++ b/usr.bin/ftp/small.c @@ -1,4 +1,4 @@ -/* $OpenBSD: small.c,v 1.5 2015/10/18 03:04:11 mmcc Exp $ */ +/* $OpenBSD: small.c,v 1.6 2016/05/25 15:36:01 krw Exp $ */ /* $NetBSD: cmds.c,v 1.27 1997/08/18 10:20:15 lukem Exp $ */ /* @@ -275,6 +275,10 @@ usage: goto freegetit; if (stbuf.st_mtime >= mtime) { rval = 1; + fprintf(ttyout, + "Local file \"%s\" is newer "\ + "than remote file \"%s\".\n", + argv[2], argv[1]); goto freegetit; } } |