summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkrw <krw@openbsd.org>2016-05-25 15:36:01 +0000
committerkrw <krw@openbsd.org>2016-05-25 15:36:01 +0000
commit694bf8d83d2e20b6e9eafa281e66f629fd37b063 (patch)
tree5b03cc9f593cb5cbdbcd0dafdf99690f27bd26d8
parentregen (diff)
downloadwireguard-openbsd-694bf8d83d2e20b6e9eafa281e66f629fd37b063.tar.xz
wireguard-openbsd-694bf8d83d2e20b6e9eafa281e66f629fd37b063.zip
Avoid a use-after-free.
Diff from Vladimir Sotirov via tech@. Thanks! ok millert@
-rw-r--r--usr.bin/ftp/cmds.c6
-rw-r--r--usr.bin/ftp/small.c6
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;
}
}