Fix (minor) problems found by ubsan

Reviewed-by: Rich Salz <rsalz@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
This commit is contained in:
Alessandro Ghedini 2015-10-17 21:28:25 +02:00 committed by Andy Polyakov
parent c880b3e314
commit 3003e0a422
2 changed files with 7 additions and 2 deletions

View File

@ -139,7 +139,7 @@ static void scryptROMix(unsigned char *B, uint64_t r, uint64_t N,
*pV = *pB++;
*pV |= *pB++ << 8;
*pV |= *pB++ << 16;
*pV |= *pB++ << 24;
*pV |= (uint32_t)*pB++ << 24;
}
for (i = 1; i < N; i++, pV += 32 * r)

View File

@ -454,7 +454,12 @@ static int verify_alpn(SSL *client, SSL *server)
OPENSSL_free(alpn_selected);
alpn_selected = NULL;
if (client_proto_len != server_proto_len ||
if (client_proto_len != server_proto_len) {
BIO_printf(bio_stdout, "ALPN selected protocols differ!\n");
goto err;
}
if (client_proto != NULL &&
memcmp(client_proto, server_proto, client_proto_len) != 0) {
BIO_printf(bio_stdout, "ALPN selected protocols differ!\n");
goto err;