From 9eb5b2ab3854c519dbaaa634d22ee557bc445b88 Mon Sep 17 00:00:00 2001 From: Jeroen Ruigrok/asmodai Date: Thu, 18 Nov 2004 12:08:01 +0000 Subject: [PATCH] Merge FreeBSD SA 04:16 security fix. Submitted by: the kind FreeBSD security officer folks --- usr.bin/fetch/fetch.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/usr.bin/fetch/fetch.c b/usr.bin/fetch/fetch.c index 968408e138..5d3978686c 100644 --- a/usr.bin/fetch/fetch.c +++ b/usr.bin/fetch/fetch.c @@ -26,7 +26,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/usr.bin/fetch/fetch.c,v 1.10.2.21 2003/06/06 06:48:42 des Exp $ - * $DragonFly: src/usr.bin/fetch/fetch.c,v 1.3 2004/08/25 01:42:26 dillon Exp $ + * $DragonFly: src/usr.bin/fetch/fetch.c,v 1.4 2004/11/18 12:08:01 asmodai Exp $ */ #include @@ -569,7 +569,8 @@ fetch(char *URL, const char *path) /* suck in the data */ signal(SIGINFO, sig_handler); while (!sigint) { - if (us.size != -1 && us.size - count < B_size) + if (us.size != -1 && us.size - count < B_size && + us.size - count >= 0) size = us.size - count; else size = B_size; -- 2.41.0