From e7b17b9c9982adac52612d977d209bc37a89f4ea Mon Sep 17 00:00:00 2001 From: jsing <> Date: Mon, 25 Sep 2017 18:07:03 +0000 Subject: 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. --- src/lib/libtls/tls_config.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/lib/libtls/tls_config.c') 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 @@ -/* $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 * @@ -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); -- cgit v1.2.3-55-g6feb