Guest User

Untitled

a guest
Mar 18th, 2018
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.32 KB | None | 0 0
  1. #include <stdint.h>
  2. #include <stdio.h>
  3. #include <stdlib.h>
  4.  
  5. int main() {
  6. uintptr_t* p1 = malloc(0x10);
  7. uintptr_t* p2 = malloc(0x10);
  8. free(p1);
  9. // XXX
  10. *p1 = (uintptr_t)p2 - 0x10;
  11. uintptr_t* p3 = malloc(0x100);
  12. free(p3);
  13. uintptr_t* p4 = malloc(0x1000);
  14.  
  15. fprintf(stderr, "Overlap p2 & p4:%p, %p\n", p2, p4);
  16. }
Add Comment
Please, Sign In to add comment