diff options
author | Joel Sing <jsing@cvs.openbsd.org> | 2019-03-19 16:56:05 +0000 |
---|---|---|
committer | Joel Sing <jsing@cvs.openbsd.org> | 2019-03-19 16:56:05 +0000 |
commit | 596b0de52d7cb4af6c0e7da6271f94d7cd44dcb0 (patch) | |
tree | d98a82575ccf6022b3c104f0d8df95090f801ef5 /lib | |
parent | 8b72ef3596e8acd2a28ba514b66ca5e8eb604e43 (diff) |
Avoid an internal 2 byte overread in ssl_sigalgs().
Found by oss-fuzz, fixes issue #13797.
ok beck@ tb@
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libssl/ssl_sigalgs.c | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/lib/libssl/ssl_sigalgs.c b/lib/libssl/ssl_sigalgs.c index fdea93e1b05..3a7f6d66875 100644 --- a/lib/libssl/ssl_sigalgs.c +++ b/lib/libssl/ssl_sigalgs.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ssl_sigalgs.c,v 1.16 2019/01/24 00:07:58 beck Exp $ */ +/* $OpenBSD: ssl_sigalgs.c,v 1.17 2019/03/19 16:56:04 jsing Exp $ */ /* * Copyright (c) 2018-2019 Bob Beck <beck@openbsd.org> * @@ -209,16 +209,11 @@ ssl_sigalg_lookup(uint16_t sigalg) const struct ssl_sigalg * ssl_sigalg(uint16_t sigalg, uint16_t *values, size_t len) { - const struct ssl_sigalg *sap; int i; for (i = 0; i < len; i++) { if (values[i] == sigalg) - break; - } - if (values[i] == sigalg) { - if ((sap = ssl_sigalg_lookup(sigalg)) != NULL) - return sap; + return ssl_sigalg_lookup(sigalg); } return NULL; |