CI Tests: fix /tests/Regression/double_free_exploit

* add missing casts to int
* add missing includes
This commit is contained in:
Martin Coufal 2024-01-31 10:54:04 +01:00 committed by codonell
parent 9b8bc360e1
commit 82e9f5dfc6
2 changed files with 9 additions and 5 deletions

View File

@ -1,6 +1,7 @@
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main(void) {
unsigned int *chunk;
@ -17,8 +18,8 @@ int main(void) {
*/
chunk[0] = -0x10; /* prev_size */
chunk[1] = 0x8; /* size */
chunk[2] = shellcode; /* fd */
chunk[3] = shellcode; /* bk */
chunk[2] = (int) shellcode; /* fd */
chunk[3] = (int) shellcode; /* bk */
/* set fd to the adres of the return address - 3
the minus 3 is needed because fd[3] will become bk

View File

@ -1,4 +1,7 @@
main()
#include <stdlib.h>
#include <stdio.h>
int main()
{
int *a,*b,*c,*d,*e;
b=malloc(8);