Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.bin/ftp servername cannot be NULL here.



details:   https://anonhg.NetBSD.org/src/rev/9882456f6ff9
branches:  trunk
changeset: 340564:9882456f6ff9
user:      wiz <wiz%NetBSD.org@localhost>
date:      Sat Sep 12 20:23:27 2015 +0000

description:
servername cannot be NULL here.

Noted by joerg@.

diffstat:

 usr.bin/ftp/ssl.c |  14 ++++++--------
 1 files changed, 6 insertions(+), 8 deletions(-)

diffs (35 lines):

diff -r 582febf78068 -r 9882456f6ff9 usr.bin/ftp/ssl.c
--- a/usr.bin/ftp/ssl.c Sat Sep 12 20:20:30 2015 +0000
+++ b/usr.bin/ftp/ssl.c Sat Sep 12 20:23:27 2015 +0000
@@ -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 @@
                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);



Home | Main Index | Thread Index | Old Index