fix: check payload fd
This commit is contained in:
parent
fa004f3a6a
commit
f83b053fcb
Binary file not shown.
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue