Second attempt to fix segfault happening with an empty interface section (see issue #9)
authorHenning Rogge <hrogge@googlemail.com>
Tue, 15 Jun 2010 16:21:09 +0000 (18:21 +0200)
committerHenning Rogge <hrogge@googlemail.com>
Tue, 15 Jun 2010 16:21:09 +0000 (18:21 +0200)
src/olsr_cfg.c

index b29f4e8..e062c49 100644 (file)
@@ -443,7 +443,7 @@ parse_cfg_interface(char *argstr, struct olsr_config *rcfg, char *rmsg)
         char **p_next = tok_next;
         struct olsr_if_config *new_if = queue_if(p[0], rcfg);
         PARSER_DEBUG_PRINTF("Interface %s\n", p[0]);
-        while (new_if && p_next[0]) {
+        while (new_if && p_next && p_next[0]) {
           if (!p_next[1]) {
             sprintf(rmsg, "Odd args in %s\n", nxt);
             parse_tok_free(tok_next);