summaryrefslogtreecommitdiff
path: root/lib/libc
diff options
context:
space:
mode:
authorjanjaap <janjaap@cvs.openbsd.org>1998-06-02 16:15:29 +0000
committerjanjaap <janjaap@cvs.openbsd.org>1998-06-02 16:15:29 +0000
commit55bad73e3e379fa7d8f92120e0e3d0549800953e (patch)
treeed5b742579d519f1069ddd757a8483d62d8207e4 /lib/libc
parentb5f04b19fa156df37b77d8a7d6276273d95c9a4f (diff)
nbytes - ofs should never be less than 0 (Oops on me)
Diffstat (limited to 'lib/libc')
-rw-r--r--lib/libc/hash/rmd160.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/libc/hash/rmd160.c b/lib/libc/hash/rmd160.c
index ab0fec25f04..eb484bb02c4 100644
--- a/lib/libc/hash/rmd160.c
+++ b/lib/libc/hash/rmd160.c
@@ -335,6 +335,8 @@ void RMD160Update(context, data, nbytes)
if (context->buflen > 0) {
ofs = 64 - context->buflen;
+ if ( ofs > nbytes )
+ ofs = nbytes;
(void)memcpy(context->bbuffer + context->buflen, data, ofs);
#if BYTE_ORDER == LITTLE_ENDIAN
(void)memcpy(X, context->bbuffer, sizeof(X));