dvb: fix the table parsing logic to avoid segfaults
authorMauro Carvalho Chehab <mchehab@redhat.com>
Fri, 11 May 2012 20:19:07 +0000 (17:19 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Fri, 11 May 2012 20:20:26 +0000 (17:20 -0300)
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
utils/dvb/dvb-file.c

index eb269b4..e1f2195 100644 (file)
@@ -141,7 +141,7 @@ struct dvb_file *parse_format_oneline(const char *fname,
                        }
                        if (table->size) {
                                for (j = 0; j < table->size; j++)
-                                       if (!strcasecmp(table->table[j], p))
+                                       if (!table->table[j] || !strcasecmp(table->table[j], p))
                                                break;
                                if (j == table->size) {
                                        sprintf(err_msg, "parameter %s invalid: %s",