T
Tommy
Hi all. I am studying computer security, and I got this short and
simple (?) c-code. Something is logical wrong in this code, and if
used in the wrong hands of someone, it could be taken advantage of.
Here is the code:
main ()
{ char buffer[1024];
GetPassword(buffer);
....
}
/*****/
int GetPassword (char *buffer,char *username)
{
....
}
Now, I am not a programmer, but is it correct that the logical fault
in this program is that the function takes to arguments, and only 1
argument is sent to it? Could this be misused`?
The asterix has something to do with pointers. *buffer means that it
is working on the original buffer-variable, or what?
I hope anyone can help me get some ideas out of this code.
simple (?) c-code. Something is logical wrong in this code, and if
used in the wrong hands of someone, it could be taken advantage of.
Here is the code:
main ()
{ char buffer[1024];
GetPassword(buffer);
....
}
/*****/
int GetPassword (char *buffer,char *username)
{
....
}
Now, I am not a programmer, but is it correct that the logical fault
in this program is that the function takes to arguments, and only 1
argument is sent to it? Could this be misused`?
The asterix has something to do with pointers. *buffer means that it
is working on the original buffer-variable, or what?
I hope anyone can help me get some ideas out of this code.