buffer overflow - C++ code exploit -


i learning basic buffer overflow issues, can please explain how code can exploited.

char gwelcome [] = "welcome our system! ";  void echo (int fd) {     int len;     char name [64], reply [128];      len = strlen (gwelcome);     memcpy (reply, gwelcome, len); /* copy welcome string reply */      write_to_socket (fd, "type name: "); /* prompt client name */     read (fd, name, 128);                     /* read name socket */      /* copy name reply buffer (starting @ offet len,      * won't overwrite welcome message copied earlier). */     memcpy (reply+len, name, 64);      write (fd, reply, len + 64);     return; }  void server (int socketfd) {     while (1)         echo (socketfd); } 


Comments

Popular posts from this blog

magento2 - Magento 2 admin grid add filter to collection -

Android volley - avoid multiple requests of the same kind to the server? -

Combining PHP Registration and Login into one class with multiple functions in one PHP file -