X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=src%2Fbin%2Flttng-sessiond%2Fsyscall.c;h=6ee38bd0fa27a3f51c5541f8601a890d130b8aed;hb=6faa26cafc21ce8d5b8f20ae4d2682092fd74b03;hp=a994da52bbda8460b9e138e0426827e98531a629;hpb=39e3c47a70c252835593bf39d6f206cfb38aec80;p=lttng-tools.git diff --git a/src/bin/lttng-sessiond/syscall.c b/src/bin/lttng-sessiond/syscall.c index a994da52b..6ee38bd0f 100644 --- a/src/bin/lttng-sessiond/syscall.c +++ b/src/bin/lttng-sessiond/syscall.c @@ -51,7 +51,7 @@ int syscall_init_table(void) fd = kernctl_syscall_list(kernel_tracer_fd); if (fd < 0) { - ret = -errno; + ret = fd; PERROR("kernelctl syscall list"); goto error_ioctl; } @@ -82,7 +82,7 @@ int syscall_init_table(void) /* Double memory size. */ new_nbmem = max(index, nbmem << 1); - if (new_nbmem < nbmem) { + if (new_nbmem > (SIZE_MAX / sizeof(*new_list))) { /* Overflow, stop everything, something went really wrong. */ ERR("Syscall listing memory size overflow. Stopping"); free(syscall_table);