Browse Source

nbytes - ofs should never be less than 0 (Oops on me)

OPENBSD_2_4
janjaap 26 years ago
parent
commit
97cd732f2f
1 changed files with 2 additions and 0 deletions
  1. +2
    -0
      src/lib/libc/hash/rmd160.c

+ 2
- 0
src/lib/libc/hash/rmd160.c View File

@ -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));


Loading…
Cancel
Save