X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=crypto%2Fmd32_common.h;h=279916fa5902b918543f63540aa1315ad992354f;hb=cec2af75102df52c2f270b3751e3487f47fccb6c;hp=089c4502905c68d78a5b267bc93a2e124b5a2b73;hpb=20f7563f3dedfcba61756ec2f97fcbd64aea1dd1;p=oweals%2Fopenssl.git diff --git a/crypto/md32_common.h b/crypto/md32_common.h index 089c450290..279916fa59 100644 --- a/crypto/md32_common.h +++ b/crypto/md32_common.h @@ -293,7 +293,7 @@ int HASH_UPDATE (HASH_CTX *c, const void *data_, size_t len) * Wei Dai for pointing it out. */ if (l < c->Nl) /* overflow */ c->Nh++; - c->Nh+=(len>>29); /* might cause compiler warning on 16-bit */ + c->Nh+=(HASH_LONG)(len>>29); /* might cause compiler warning on 16-bit */ c->Nl=l; n = c->num; @@ -301,7 +301,7 @@ int HASH_UPDATE (HASH_CTX *c, const void *data_, size_t len) { p=(unsigned char *)c->data; - if ((n+len) >= HASH_CBLOCK) + if (len >= HASH_CBLOCK || len+n >= HASH_CBLOCK) { memcpy (p+n,data,HASH_CBLOCK-n); HASH_BLOCK_DATA_ORDER (c,p,1); @@ -331,7 +331,7 @@ int HASH_UPDATE (HASH_CTX *c, const void *data_, size_t len) if (len != 0) { p = (unsigned char *)c->data; - c->num = len; + c->num = (unsigned int)len; memcpy (p,data,len); } return 1;