summaryrefslogtreecommitdiff
path: root/sys/netinet/ip_rmd160.c
diff options
context:
space:
mode:
authorjanjaap <janjaap@cvs.openbsd.org>1998-06-02 16:12:41 +0000
committerjanjaap <janjaap@cvs.openbsd.org>1998-06-02 16:12:41 +0000
commitb5f04b19fa156df37b77d8a7d6276273d95c9a4f (patch)
tree7b6349a19fa1fc341a0e9f83fe33248c6dfc8890 /sys/netinet/ip_rmd160.c
parentbe581e2170d9ae8e19488ad906aff1cee947edee (diff)
nbytes - ofs should never be less than 0 (Oops on me)
Diffstat (limited to 'sys/netinet/ip_rmd160.c')
-rw-r--r--sys/netinet/ip_rmd160.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/netinet/ip_rmd160.c b/sys/netinet/ip_rmd160.c
index 457642f06a5..f50d1cd44d3 100644
--- a/sys/netinet/ip_rmd160.c
+++ b/sys/netinet/ip_rmd160.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ip_rmd160.c,v 1.3 1998/03/23 15:17:47 janjaap Exp $ */
+/* $OpenBSD: ip_rmd160.c,v 1.4 1998/06/02 16:12:40 janjaap Exp $ */
/********************************************************************\
*
* FILE: rmd160.c
@@ -336,6 +336,8 @@ void RMD160Update(context, data, nbytes)
if (context->buflen > 0) {
ofs = 64 - context->buflen;
+ if ( ofs > nbytes )
+ ofs = nbytes;
bcopy(data, context->bbuffer + context->buflen, ofs);
#if BYTE_ORDER == LITTLE_ENDIAN
bcopy(context->bbuffer, X, sizeof(X));