diff options
author | Ricardo Mestre <mestre@cvs.openbsd.org> | 2016-11-30 07:55:25 +0000 |
---|---|---|
committer | Ricardo Mestre <mestre@cvs.openbsd.org> | 2016-11-30 07:55:25 +0000 |
commit | ecc0e680007a23935fc353179c5b481968b67f32 (patch) | |
tree | ff0861dedb278c5d568a72a795e986efba5fc7db /usr.bin | |
parent | f813ba054b96003e6cb41bbddb32ebad1b453ba2 (diff) |
Check return value of tls_config_set_protocols(3) and bail out in case of
failure
Feedback and OK jsing@
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/ftp/main.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/usr.bin/ftp/main.c b/usr.bin/ftp/main.c index 99de864a88b..94e83c10f07 100644 --- a/usr.bin/ftp/main.c +++ b/usr.bin/ftp/main.c @@ -1,4 +1,4 @@ -/* $OpenBSD: main.c,v 1.111 2016/11/06 13:16:50 jsing Exp $ */ +/* $OpenBSD: main.c,v 1.112 2016/11/30 07:55:24 mestre Exp $ */ /* $NetBSD: main.c,v 1.24 1997/08/18 10:20:26 lukem Exp $ */ /* @@ -251,7 +251,10 @@ main(volatile int argc, char *argv[]) tls_config = tls_config_new(); if (tls_config == NULL) errx(1, "tls config failed"); - tls_config_set_protocols(tls_config, TLS_PROTOCOLS_ALL); + if (tls_config_set_protocols(tls_config, + TLS_PROTOCOLS_ALL) != 0) + errx(1, "tls set protocols failed: %s", + tls_config_error(tls_config)); if (tls_config_set_ciphers(tls_config, "legacy") != 0) errx(1, "tls set ciphers failed: %s", tls_config_error(tls_config)); |