mirror of
https://github.com/openssl/openssl.git
synced 2025-01-18 13:44:20 +08:00
Cast the unsigned char to unsigned int before shifting left
This is needed to avoid automatic promotion to signed int. Fixes #11853 [extended tests] Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/11857)
This commit is contained in:
parent
ddec332f32
commit
cbeb0bfa96
@ -36,10 +36,10 @@ static unsigned int read_ledword(const unsigned char **in)
|
||||
{
|
||||
const unsigned char *p = *in;
|
||||
unsigned int ret;
|
||||
ret = *p++;
|
||||
ret |= (*p++ << 8);
|
||||
ret |= (*p++ << 16);
|
||||
ret |= (*p++ << 24);
|
||||
ret = (unsigned int)*p++;
|
||||
ret |= (unsigned int)*p++ << 8;
|
||||
ret |= (unsigned int)*p++ << 16;
|
||||
ret |= (unsigned int)*p++ << 24;
|
||||
*in = p;
|
||||
return ret;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user