Fix: syscall_list_show NULL pointer deref
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mon, 22 Sep 2014 19:30:51 +0000 (15:30 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fri, 26 Sep 2014 16:10:00 +0000 (12:10 -0400)
Also make sure the syscall listing index matches the bitmask.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
lttng-syscalls.c

index 96d90c58c586a2affa6d46ed17c993c69bcb98cb..4eae6747f692c1149adbb5d52fef45a5b8e19ea0 100644 (file)
@@ -1152,8 +1152,11 @@ int syscall_list_show(struct seq_file *m, void *p)
        ret = get_sc_table(entry, &table, &bitness);
        if (ret)
                return ret;
+       if (!entry->desc)
+               return 0;
        seq_printf(m,   "syscall { index = %lu; name = %s; bitness = %u; };\n",
-               entry - table,
+               table == sc_table ? entry - table :
+                       (entry - table) + ARRAY_SIZE(sc_table),
                entry->desc->name,
                bitness);
        return 0;
This page took 0.028002 seconds and 4 git commands to generate.