This commit is contained in:
firmianay
2018-06-08 20:46:05 +08:00
parent 77551e0470
commit a0ebe4a208
26 changed files with 961 additions and 119 deletions

View File

@ -0,0 +1,11 @@
#include <stdio.h>
#include <stdlib.h>
int main() {
void *x = malloc(10);
printf("malloc(10): %p\n", x);
free(x);
void *y = malloc(((size_t)~0) - 2); // overflow allocation (size_t.max-2)
printf("malloc(((size_t)~0) - 2): %p\n", y);
}