]> andersk Git - openssh.git/blobdiff - readconf.c
- (tim) [configure.ac] Some platforms need sys/types.h for arpa/nameser.h.
[openssh.git] / readconf.c
index e50a422222c41b36af05ca44dcfb94a62f0de661..d41220807ad0df0d9d38b969a2d477cb9b36af59 100644 (file)
@@ -12,7 +12,7 @@
  */
 
 #include "includes.h"
-RCSID("$OpenBSD: readconf.c,v 1.136 2005/03/01 10:40:26 djm Exp $");
+RCSID("$OpenBSD: readconf.c,v 1.140 2005/05/16 15:30:51 markus Exp $");
 
 #include "ssh.h"
 #include "xmalloc.h"
@@ -253,12 +253,14 @@ clear_forwardings(Options *options)
        int i;
 
        for (i = 0; i < options->num_local_forwards; i++) {
-               xfree(options->local_forwards[i].listen_host);
+               if (options->local_forwards[i].listen_host != NULL)
+                       xfree(options->local_forwards[i].listen_host);
                xfree(options->local_forwards[i].connect_host);
        }
        options->num_local_forwards = 0;
        for (i = 0; i < options->num_remote_forwards; i++) {
-               xfree(options->remote_forwards[i].listen_host);
+               if (options->remote_forwards[i].listen_host != NULL)
+                       xfree(options->remote_forwards[i].listen_host);
                xfree(options->remote_forwards[i].connect_host);
        }
        options->num_remote_forwards = 0;
@@ -299,7 +301,7 @@ process_config_line(Options *options, const char *host,
        Forward fwd;
 
        /* Strip trailing whitespace */
-       for(len = strlen(line) - 1; len > 0; len--) {
+       for (len = strlen(line) - 1; len > 0; len--) {
                if (strchr(WHITESPACE, line[len]) == NULL)
                        break;
                line[len] = '\0';
@@ -741,6 +743,9 @@ parse_int:
 
        case oAddressFamily:
                arg = strdelim(&s);
+               if (!arg || *arg == '\0')
+                       fatal("%s line %d: missing address family.",
+                           filename, linenum);
                intptr = &options->address_family;
                if (strcasecmp(arg, "inet") == 0)
                        value = AF_INET;
@@ -775,6 +780,8 @@ parse_int:
                        if (strchr(arg, '=') != NULL)
                                fatal("%s line %d: Invalid environment name.",
                                    filename, linenum);
+                       if (!*activep)
+                               continue;
                        if (options->num_send_env >= MAX_SEND_ENV)
                                fatal("%s line %d: too many send env.",
                                    filename, linenum);
This page took 0.035143 seconds and 4 git commands to generate.