CI Tests: fix /tests/Regression/double_free_exploit
* add missing casts to int * add missing includes
This commit is contained in:
parent
9b8bc360e1
commit
82e9f5dfc6
@ -1,6 +1,7 @@
|
|||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
int main(void) {
|
int main(void) {
|
||||||
unsigned int *chunk;
|
unsigned int *chunk;
|
||||||
@ -17,8 +18,8 @@ int main(void) {
|
|||||||
*/
|
*/
|
||||||
chunk[0] = -0x10; /* prev_size */
|
chunk[0] = -0x10; /* prev_size */
|
||||||
chunk[1] = 0x8; /* size */
|
chunk[1] = 0x8; /* size */
|
||||||
chunk[2] = shellcode; /* fd */
|
chunk[2] = (int) shellcode; /* fd */
|
||||||
chunk[3] = shellcode; /* bk */
|
chunk[3] = (int) shellcode; /* bk */
|
||||||
|
|
||||||
/* set fd to the adres of the return address - 3
|
/* set fd to the adres of the return address - 3
|
||||||
the minus 3 is needed because fd[3] will become bk
|
the minus 3 is needed because fd[3] will become bk
|
||||||
|
@ -1,4 +1,7 @@
|
|||||||
main()
|
#include <stdlib.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
|
int main()
|
||||||
{
|
{
|
||||||
int *a,*b,*c,*d,*e;
|
int *a,*b,*c,*d,*e;
|
||||||
b=malloc(8);
|
b=malloc(8);
|
||||||
|
Loading…
Reference in New Issue
Block a user