0

I am learning about code auditing, and I have a question relating to the argc/argv[] variables. I think that the argc is an integer type, so would enough command line arguments overflow the buffer? I know that it's a stretch, but I am looking for the third vulnerability in our practice program, and I can't find it. Any advice would be great!

Thanks for reading this!

Stephen

4
Contributors
3
Replies
4
Views
8 Years
Discussion Span
Last Post by Tom Gunn
0

If your going that route I would check the sizeof(argc) just to see what your dealing with, .i.e is it an unsigned char, unsigned short or whatever

Just to see what size of variables are accepted

Edited by gerard4143: n/a

0

I am learning about code auditing, and I have a question relating to the argc/argv[] variables. I think that the argc is an integer type, so would enough command line arguments overflow the buffer? I know that it's a stretch, but I am looking for the third vulnerability in our practice program, and I can't find it. Any advice would be great!

If the host environment is going to provide them, I wouldn't expect it to give you something that overflows. Rather, if the possibility of overflow were available, I would expect the host environment to do something like make argc zero to avoid the potential issue.

If your going that route I would check the sizeof(argc) just to see what your dealing with, .i.e is it an unsigned char, unsigned short or whatever

Just to see what size of variables are accepted

???

If you have an argc, it's an int.

0

I know that it's a stretch, but I am looking for the third vulnerability in our practice program, and I can't find it.

It's a big stretch. Even with the minimum range of int and no safeguards by the runtime, there would have to be 32,768 command line arguments to overflow argc. Your practice program probably has a different third vulnerability. Is it possible to post the code?

Edited by Tom Gunn: n/a

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.