This produces "Run-Time Check Failure #2 - Stack around the variable 'loader' was corrupted." if running in debug mode when function Test() exits or buffer overrun if running in release.
Any idea?
Instead...
void Test()
{
CONFIG loader;
loader.b_ptz = true;
}
doesn't produce any buffer overrun....
This mostly looks like C, but there are a few bits of C++ in there. Given that you're using C++, it would probably be safer and easier to use std::strings rather than fixed-size char arrays, so long as you're aware of the caveats when working with non-POD types.
I don't see a main() function there, so I can't give your program a test run. I certainly don't see anything which could cause a buffer overflow offhand.
Edit the post, and paste properly formatted source. Highlight it and press that little # key to add code tags. If we could read it and if there was a main function that compiles we could read it and give it a test run. I'm not even going to try to decipher that original post.
Bookmarks