Advertisement
Guest User

Untitled

a guest
Sep 20th, 2013
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1.  
  2.  
  3. -bash-3.2$ cat foo.c
  4. #include <sys/socket.h>
  5.  
  6. extern ssize_t recvfrom(int s, void *buf, size_t len, int flags, struct sockaddr *from, socklen_t *fromlen);
  7.  
  8. ssize_t foo()
  9. {
  10. int s;
  11. void *buf;
  12. size_t len;
  13. int flags;
  14. struct sockaddr *from;
  15. socklen_t* fromlen;
  16.  
  17. return(recvfrom(s, buf, len, flags, from, fromlen));
  18. }
  19.  
  20. int main(int argc, const char **argv)
  21. {
  22. return foo();
  23. }
  24.  
  25.  
  26. # this fails with these compiler flags:
  27. $ gcc -Wp,-D_FORTIFY_SOURCE=2 -O2 -D_GNU_SOURCE=1 foo.c
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement