:[ Forums ]:
Topic: C program | buffer overflow
| Author: | Message: |
| therock_wall Offline Forum Rank: kiddie ![]() ![]() Posts: 48 Thanks: 0 Standard User | This is a simple C program but i am unable to decode it .
<------------ C PROGRAM STARTS HERE ------------> #include <stdio.h> #include <string.h> void echo(char* input) { char buf[16]; strcpy(buf, input); printf("%s\n", buf); } int main(int argc, char **argv) { echo(argv[1]); // call the function to print the first 16 characters return 0; // denote that the program has finished executing successfully } <------------ C PROGRAM ENDS HERE -------------> the output of the above code is => segmentation fault:11 i want to know whether the above code is a victim of buffer overflow and if yes what is the exploit code and a basic explanation. thanx in advance ![]() |
| #1 Back To Top |
Locked.
Online (last 15 mins): metallover


