diff options
author | Joel Sing <jsing@cvs.openbsd.org> | 2017-09-25 18:07:04 +0000 |
---|---|---|
committer | Joel Sing <jsing@cvs.openbsd.org> | 2017-09-25 18:07:04 +0000 |
commit | 7a43b900585a2ebceb5e776f7b8ccda7c80db609 (patch) | |
tree | e18b83f2e4c0ede98665b165b2b3c5669d9102a3 /lib | |
parent | 055c8cd33ec0d2907c3189829977e7df77beef75 (diff) |
If tls_config_parse_protocols() is called with a NULL pointer, return the
default protocols instead of crashing - this makes the behaviour more
useful and mirrors what we already do in tls_config_set_ciphers() et al.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libtls/tls_config.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/libtls/tls_config.c b/lib/libtls/tls_config.c index 581c493a559..777dfc52f0f 100644 --- a/lib/libtls/tls_config.c +++ b/lib/libtls/tls_config.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tls_config.c,v 1.43 2017/08/10 18:18:30 jsing Exp $ */ +/* $OpenBSD: tls_config.c,v 1.44 2017/09/25 18:07:03 jsing Exp $ */ /* * Copyright (c) 2014 Joel Sing <jsing@openbsd.org> * @@ -311,6 +311,9 @@ tls_config_parse_protocols(uint32_t *protocols, const char *protostr) char *s, *p, *q; int negate; + if (protostr == NULL) + return TLS_PROTOCOLS_DEFAULT; + if ((s = strdup(protostr)) == NULL) return (-1); |