Files
metasploit-gs/external/source/byakugan/test/testDoubleFree.c
T
HD Moore 8dc54f35d3 Merging from the byakugan branch
git-svn-id: file:///home/svn/framework3/trunk@5633 4d416f70-5f16-0410-b530-b9f4589650da
2008-08-20 19:27:03 +00:00

20 lines
293 B
C

#include <windows.h>
#define NUMPTRS 10
int main(int argc, char **argv) {
char *foo[NUMPTRS];
int i;
Sleep(10000);
for (i = 0; i < NUMPTRS; i++) {
foo[i] = malloc(256);
printf("%d: 0x%08x\n", i, foo[i]);
}
for (i = 0; i < NUMPTRS; i+=2) {
free(foo[i]);
}
free(foo[i-2]);
}