diff options
author | Theo Buehler <tb@cvs.openbsd.org> | 2020-09-14 17:52:39 +0000 |
---|---|---|
committer | Theo Buehler <tb@cvs.openbsd.org> | 2020-09-14 17:52:39 +0000 |
commit | dc3d0ce57236d950da548c363d40f8b2949e9c81 (patch) | |
tree | bd53d06f5ea0b1dceedc2f02da9829630d6b9931 /lib/libssl/ssl_ciphers.c | |
parent | 80df7e3b2adefb2db5ea6317b9a03ef61551ab52 (diff) |
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
Diffstat (limited to 'lib/libssl/ssl_ciphers.c')
-rw-r--r-- | lib/libssl/ssl_ciphers.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/libssl/ssl_ciphers.c b/lib/libssl/ssl_ciphers.c index d84e4c6154c..0912fb6d257 100644 --- a/lib/libssl/ssl_ciphers.c +++ b/lib/libssl/ssl_ciphers.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ssl_ciphers.c,v 1.7 2020/09/13 16:49:05 jsing Exp $ */ +/* $OpenBSD: ssl_ciphers.c,v 1.8 2020/09/14 17:52:38 tb Exp $ */ /* * Copyright (c) 2015-2017 Doug Hogan <doug@openbsd.org> * 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) while ((p = strsep(&q, ":")) != NULL) { ciphersuite = &ssl_tls13_ciphersuites[0]; for (i = 0; ciphersuite->name != NULL; i++) { - ciphersuite = &ssl_tls13_ciphersuites[i]; if (strcmp(p, ciphersuite->name) == 0) break; if (strcmp(p, ciphersuite->alias) == 0) break; + ciphersuite = &ssl_tls13_ciphersuites[i]; } if (ciphersuite->name == NULL) goto err; |