Advertisement
Guest User

Untitled

a guest
Dec 18th, 2014
173
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <string.h>
  4.  
  5. void fonc2(char * result) {
  6. strcpy(result, "TOTO"); // Overwrites the pointed to by result
  7. result[0]= 0x41; // This is (hopefully not) crashing...
  8. printf("%s %p\n", result, (void *)&result);
  9. }
  10.  
  11. void main() {
  12. char toto[] = "TRUC";
  13. fonc2(toto);
  14. printf("%s %p\n", toto, (void *)&toto);
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement