The orig list parsing tries to gather information from 4 columns for each line.
The second part of the parsing routine should only be started when all
columns could be found. Otherwise parts of the variables are uninitialized.
Dereferencing iface in such a situation can cause a segfault.

Signed-off-by: Sven Eckelmann <[email protected]>

---
 vis/vis.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/vis/vis.c b/vis/vis.c
index 31f60d7..2928d65 100644
--- a/vis/vis.c
+++ b/vis/vis.c
@@ -350,7 +350,7 @@ static int parse_orig_list(struct globals *globals)
                        default: break;
                        }
                }
-               if (tnum >= 4) {
+               if (tnum > 4) {
                        if (strcmp(dest, neigh) == 0) {
                                tq_val = strtol(tq, NULL, 10);
                                if (tq_val < 1 || tq_val > 255)
-- 
2.0.0.rc2

Reply via email to