diff --git a/srcs/.woody.c.swp b/srcs/.woody.c.swp new file mode 100644 index 0000000..db76144 Binary files /dev/null and b/srcs/.woody.c.swp differ diff --git a/srcs/woody.c b/srcs/woody.c index 154d178..dc73446 100644 --- a/srcs/woody.c +++ b/srcs/woody.c @@ -87,6 +87,11 @@ t_payload *get_payload() return NULL; char buffer[1024]; int fd = open("payload", O_RDONLY); + if (fd == -1) { + perror("error opening payload"); + free(payload); + exit(1); + } payload->len = read(fd, buffer, 1024); payload->payload = malloc(sizeof(char) * payload->len); ft_memcpy(payload->payload, buffer, payload->len); @@ -211,4 +216,4 @@ int prepare_injection(t_efl_content *woody) save_elf("woody", woody_file, woody->file_size); free(woody_file); return EXIT_SUCCESS; -} \ No newline at end of file +}