diff options
author | 1998-06-02 16:12:40 +0000 | |
---|---|---|
committer | 1998-06-02 16:12:40 +0000 | |
commit | 20c8b50b64fe78bf83aa6bd3d02c1bd20b678ae7 (patch) | |
tree | f9cecc41c0934c229be0c9866b78014bbd739cf2 /lib/libc/hash/rmd160.c | |
parent | shut up -Wall (diff) | |
download | wireguard-openbsd-20c8b50b64fe78bf83aa6bd3d02c1bd20b678ae7.tar.xz wireguard-openbsd-20c8b50b64fe78bf83aa6bd3d02c1bd20b678ae7.zip |
nbytes - ofs should never be less than 0 (Oops on me)
Diffstat (limited to 'lib/libc/hash/rmd160.c')
-rw-r--r-- | lib/libc/hash/rmd160.c | 2 |
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)); |