Module Name: src
Committed By: wiz
Date: Sat Sep 12 20:23:27 UTC 2015
Modified Files:
src/usr.bin/ftp: ssl.c
Log Message:
servername cannot be NULL here.
Noted by joerg@.
To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/usr.bin/ftp/ssl.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/usr.bin/ftp/ssl.c
diff -u src/usr.bin/ftp/ssl.c:1.3 src/usr.bin/ftp/ssl.c:1.4
--- src/usr.bin/ftp/ssl.c:1.3 Sat Sep 12 19:38:42 2015
+++ src/usr.bin/ftp/ssl.c Sat Sep 12 20:23:27 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: ssl.c,v 1.3 2015/09/12 19:38:42 wiz Exp $ */
+/* $NetBSD: ssl.c,v 1.4 2015/09/12 20:23:27 wiz Exp $ */
/*-
* Copyright (c) 1998-2004 Dag-Erling Coïdan Smørgrav
@@ -34,7 +34,7 @@
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: ssl.c,v 1.3 2015/09/12 19:38:42 wiz Exp $");
+__RCSID("$NetBSD: ssl.c,v 1.4 2015/09/12 20:23:27 wiz Exp $");
#endif
#include <time.h>
@@ -570,12 +570,10 @@ fetch_start_ssl(int sock, const char *se
return NULL;
}
SSL_set_fd(ssl, sock);
- if (servername != NULL) {
- if (!SSL_set_tlsext_host_name(ssl, servername)) {
- fprintf(ttyout, "SSL hostname setting failed\n");
- SSL_CTX_free(ctx);
- return NULL;
- }
+ if (!SSL_set_tlsext_host_name(ssl, servername)) {
+ fprintf(ttyout, "SSL hostname setting failed\n");
+ SSL_CTX_free(ctx);
+ return NULL;
}
while ((ret = SSL_connect(ssl)) == -1) {
ssl_err = SSL_get_error(ssl, ret);