From: Mathieu Desnoyers Date: Mon, 22 Sep 2014 19:30:51 +0000 (-0400) Subject: Fix: syscall_list_show NULL pointer deref X-Git-Tag: v2.6.0-rc1~27 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=f4855b46cb97a7ad649e97232719c50ab8688119;p=lttng-modules.git Fix: syscall_list_show NULL pointer deref Also make sure the syscall listing index matches the bitmask. Signed-off-by: Mathieu Desnoyers --- diff --git a/lttng-syscalls.c b/lttng-syscalls.c index 96d90c58..4eae6747 100644 --- a/lttng-syscalls.c +++ b/lttng-syscalls.c @@ -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;