Fix: sessiond: fix possible buffer overflow warning
[lttng-tools.git] / src / bin / lttng-sessiond / lttng-syscall.c
index 16eead6260783fd0d6ce1742004489623133e129..b6a9a53acd757dc1888231674103ea74583da97b 100644 (file)
@@ -39,6 +39,10 @@ int syscall_init_table(int tracer_fd)
        uint32_t bitness;
        char name[SYSCALL_NAME_LEN];
 
+#if (SYSCALL_NAME_LEN == 255)
+#define SYSCALL_NAME_LEN_SCANF_IS_A_BROKEN_API "254"
+#endif
+
        DBG3("Syscall init system call table");
 
        fd = kernctl_syscall_list(tracer_fd);
@@ -65,7 +69,7 @@ int syscall_init_table(int tracer_fd)
 
        while (fscanf(fp,
                                "syscall { index = %zu; \
-                               name = %" XSTR(SYSCALL_NAME_LEN) "[^;]; \
+                               name = %" SYSCALL_NAME_LEN_SCANF_IS_A_BROKEN_API "[^;]; \
                                bitness = %u; };\n",
                                &index, name, &bitness) == 3) {
                at_least_one_syscall = true;
This page took 0.024024 seconds and 5 git commands to generate.