diff options
author | tb <> | 2020-09-14 17:52:38 +0000 |
---|---|---|
committer | tb <> | 2020-09-14 17:52:38 +0000 |
commit | 5e7d41625cac7c0e2822615ddfb6f5422b284437 (patch) | |
tree | 653fe64272f8d9e955ef9a98d9b467e6d4ba4b75 | |
parent | 874099424e2acce040ab4c46131ba90623509534 (diff) | |
download | openbsd-5e7d41625cac7c0e2822615ddfb6f5422b284437.tar.gz openbsd-5e7d41625cac7c0e2822615ddfb6f5422b284437.tar.bz2 openbsd-5e7d41625cac7c0e2822615ddfb6f5422b284437.zip |
Avoid NULL deref SSL_{,CTX_}set_ciphersuites
Move assignment to the correct place so that the run continuation condition
actually checks what it is supposed to. Found by getting lucky when running
regress.
ok beck jsing
-rw-r--r-- | src/lib/libssl/ssl_ciphers.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lib/libssl/ssl_ciphers.c b/src/lib/libssl/ssl_ciphers.c index d84e4c6154..0912fb6d25 100644 --- a/src/lib/libssl/ssl_ciphers.c +++ b/src/lib/libssl/ssl_ciphers.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: ssl_ciphers.c,v 1.7 2020/09/13 16:49:05 jsing Exp $ */ | 1 | /* $OpenBSD: ssl_ciphers.c,v 1.8 2020/09/14 17:52:38 tb Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright (c) 2015-2017 Doug Hogan <doug@openbsd.org> | 3 | * Copyright (c) 2015-2017 Doug Hogan <doug@openbsd.org> |
4 | * Copyright (c) 2015-2018, 2020 Joel Sing <jsing@openbsd.org> | 4 | * Copyright (c) 2015-2018, 2020 Joel Sing <jsing@openbsd.org> |
@@ -237,11 +237,11 @@ ssl_parse_ciphersuites(STACK_OF(SSL_CIPHER) **out_ciphers, const char *str) | |||
237 | while ((p = strsep(&q, ":")) != NULL) { | 237 | while ((p = strsep(&q, ":")) != NULL) { |
238 | ciphersuite = &ssl_tls13_ciphersuites[0]; | 238 | ciphersuite = &ssl_tls13_ciphersuites[0]; |
239 | for (i = 0; ciphersuite->name != NULL; i++) { | 239 | for (i = 0; ciphersuite->name != NULL; i++) { |
240 | ciphersuite = &ssl_tls13_ciphersuites[i]; | ||
241 | if (strcmp(p, ciphersuite->name) == 0) | 240 | if (strcmp(p, ciphersuite->name) == 0) |
242 | break; | 241 | break; |
243 | if (strcmp(p, ciphersuite->alias) == 0) | 242 | if (strcmp(p, ciphersuite->alias) == 0) |
244 | break; | 243 | break; |
244 | ciphersuite = &ssl_tls13_ciphersuites[i]; | ||
245 | } | 245 | } |
246 | if (ciphersuite->name == NULL) | 246 | if (ciphersuite->name == NULL) |
247 | goto err; | 247 | goto err; |