fd = kernctl_syscall_list(kernel_tracer_fd);
if (fd < 0) {
- ret = -errno;
+ ret = fd;
PERROR("kernelctl syscall list");
goto error_ioctl;
}
/* 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);