[server] add NULL check for SNAT translate IP
authorMichael Rash <mbr@cipherdyne.org>
Sun, 4 Aug 2013 00:37:50 +0000 (20:37 -0400)
committerMichael Rash <mbr@cipherdyne.org>
Sun, 4 Aug 2013 00:37:50 +0000 (20:37 -0400)
server/fw_util_iptables.c

index be2804d..6456122 100644 (file)
@@ -1237,7 +1237,8 @@ process_spa_request(const fko_srv_options_t * const opts,
             /* Setup some parameter depending on whether we are using SNAT
              * or MASQUERADE.
             */
-            if(strncasecmp(opts->config[CONF_SNAT_TRANSLATE_IP], "__CHANGEME__", 10)!=0)
+            if((opts->config[CONF_SNAT_TRANSLATE_IP] != NULL)
+                && strncasecmp(opts->config[CONF_SNAT_TRANSLATE_IP], "__CHANGEME__", 10)!=0)
             {
                 /* Using static SNAT */
                 snat_chain = &(opts->fw_config->chain[IPT_SNAT_ACCESS]);