Advertisement
sp1d3o

overflow

Jan 1st, 2022
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.34 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <string.h>
  3. #include <stdlib.h>
  4.  
  5. int main(void)
  6. {
  7.     char buf2[16] = "overwriteme";
  8.     char buf1[16];
  9.  
  10.     strcpy(buf1, "");
  11.  
  12.     printf("buf1 val: %s\n", buf1);
  13.     printf("buf2 val: %s\n", buf2);
  14.     printf("buf1 addr: %p\n", (void *)buf1);
  15.     printf("buf2 addr: %p\n", (void *)buf2);
  16.  
  17.     return 0;
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement