Skip to content

Commit f1d95d2

Browse files
authored
Merge pull request #206 from dmur1/fix-fastbin-dup-into-stack-print-errors
fix incorrect address being printed in fastbin_dup_into_stack
2 parents d9c79f5 + 049c205 commit f1d95d2

File tree

6 files changed

+12
-12
lines changed

6 files changed

+12
-12
lines changed

glibc_2.33/fastbin_dup_into_stack.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ int main()
2020
}
2121

2222

23-
unsigned long stack_var[2] __attribute__ ((aligned (0x10)));
23+
unsigned long stack_var[4] __attribute__ ((aligned (0x10)));
2424

25-
fprintf(stderr, "The address we want calloc() to return is %p.\n", stack_var);
25+
fprintf(stderr, "The address we want calloc() to return is %p.\n", stack_var + 2);
2626

2727
fprintf(stderr, "Allocating 3 buffers.\n");
2828
int *a = calloc(1,8);

glibc_2.34/fastbin_dup_into_stack.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ int main()
2020
}
2121

2222

23-
unsigned long stack_var[2] __attribute__ ((aligned (0x10)));
23+
unsigned long stack_var[4] __attribute__ ((aligned (0x10)));
2424

25-
fprintf(stderr, "The address we want calloc() to return is %p.\n", stack_var);
25+
fprintf(stderr, "The address we want calloc() to return is %p.\n", stack_var + 2);
2626

2727
fprintf(stderr, "Allocating 3 buffers.\n");
2828
int *a = calloc(1,8);

glibc_2.36/fastbin_dup_into_stack.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ int main()
2020
}
2121

2222

23-
unsigned long stack_var[2] __attribute__ ((aligned (0x10)));
23+
unsigned long stack_var[4] __attribute__ ((aligned (0x10)));
2424

25-
fprintf(stderr, "The address we want calloc() to return is %p.\n", stack_var);
25+
fprintf(stderr, "The address we want calloc() to return is %p.\n", stack_var + 2);
2626

2727
fprintf(stderr, "Allocating 3 buffers.\n");
2828
int *a = calloc(1,8);

glibc_2.37/fastbin_dup_into_stack.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ int main()
2020
}
2121

2222

23-
unsigned long stack_var[2] __attribute__ ((aligned (0x10)));
23+
unsigned long stack_var[4] __attribute__ ((aligned (0x10)));
2424

25-
fprintf(stderr, "The address we want calloc() to return is %p.\n", stack_var);
25+
fprintf(stderr, "The address we want calloc() to return is %p.\n", stack_var + 2);
2626

2727
fprintf(stderr, "Allocating 3 buffers.\n");
2828
int *a = calloc(1,8);

glibc_2.38/fastbin_dup_into_stack.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ int main()
2020
}
2121

2222

23-
unsigned long stack_var[2] __attribute__ ((aligned (0x10)));
23+
unsigned long stack_var[4] __attribute__ ((aligned (0x10)));
2424

25-
fprintf(stderr, "The address we want calloc() to return is %p.\n", stack_var);
25+
fprintf(stderr, "The address we want calloc() to return is %p.\n", stack_var + 2);
2626

2727
fprintf(stderr, "Allocating 3 buffers.\n");
2828
int *a = calloc(1,8);

glibc_2.39/fastbin_dup_into_stack.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ int main()
2020
}
2121

2222

23-
unsigned long stack_var[2] __attribute__ ((aligned (0x10)));
23+
unsigned long stack_var[4] __attribute__ ((aligned (0x10)));
2424

25-
fprintf(stderr, "The address we want calloc() to return is %p.\n", stack_var);
25+
fprintf(stderr, "The address we want calloc() to return is %p.\n", stack_var + 2);
2626

2727
fprintf(stderr, "Allocating 3 buffers.\n");
2828
int *a = calloc(1,8);

0 commit comments

Comments
 (0)