summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorjsing <>2017-09-25 18:07:03 +0000
committerjsing <>2017-09-25 18:07:03 +0000
commite7b17b9c9982adac52612d977d209bc37a89f4ea (patch)
treeed31b2c3e412ef810981ff1fe232f7365b2286fa /src/lib
parent8b4db5e6a6fc1da58ad74b8c1fa4fed227aa4158 (diff)
downloadopenbsd-e7b17b9c9982adac52612d977d209bc37a89f4ea.tar.gz
openbsd-e7b17b9c9982adac52612d977d209bc37a89f4ea.tar.bz2
openbsd-e7b17b9c9982adac52612d977d209bc37a89f4ea.zip
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 'src/lib')
-rw-r--r--src/lib/libtls/tls_config.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/lib/libtls/tls_config.c b/src/lib/libtls/tls_config.c
index 581c493a55..777dfc52f0 100644
--- a/src/lib/libtls/tls_config.c
+++ b/src/lib/libtls/tls_config.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: tls_config.c,v 1.43 2017/08/10 18:18:30 jsing Exp $ */ 1/* $OpenBSD: tls_config.c,v 1.44 2017/09/25 18:07:03 jsing Exp $ */
2/* 2/*
3 * Copyright (c) 2014 Joel Sing <jsing@openbsd.org> 3 * Copyright (c) 2014 Joel Sing <jsing@openbsd.org>
4 * 4 *
@@ -311,6 +311,9 @@ tls_config_parse_protocols(uint32_t *protocols, const char *protostr)
311 char *s, *p, *q; 311 char *s, *p, *q;
312 int negate; 312 int negate;
313 313
314 if (protostr == NULL)
315 return TLS_PROTOCOLS_DEFAULT;
316
314 if ((s = strdup(protostr)) == NULL) 317 if ((s = strdup(protostr)) == NULL)
315 return (-1); 318 return (-1);
316 319