I am new to this and I do not understand why please help me identify buffer which overflow Maybe why?
#include & lt; Stdio.h & gt; #include & lt; String.h & gt; #define S 100 #define N 1000 int main (int argc, char * argv []) {char out [s]; Four buffs [n]; Char msg [] = "Welcome to logic acoustic program \ n"; Int len = 0; Buf [0] = '\ 0'; Printf (message); While (argc) {sprintf (outside, "argument% d% s \ n", argc-1, argv [argc-1]); Argc -; `` Strncat (buff, out, size (buf) -len-1); Lane = Stellen (buff); } Printf ("% s", buf); Return 0; }
The problem is here:
sprintf ( Outside, "argument% d is% s \ n", argc - 1, argv [argc - 1]);
When you face such a problem, the program is always a good idea to comment on lines as long as the program crashes. Then you will know where the bug is: D
Comments
Post a Comment