I have a buffer overflow that I absolutely can't see to understand (in C). First of all, this happens only in 10% of cases. The data that he pulls out of the database every time does not seem completely different, between executions ... at least, it is not quite enough to find any distinguishable template as to when this will happen. Exact message from Visual Studio:
A buffer overflow occurred in hub.exe, which ruined the internal state of the program. Press Break to debug the program or continue to end the program.
For more information, see the Help topic "How to Debug Buffer Overflow Problems".
If I am debugging, I find that it is broken into __report_gsfailure() , which I am sure is the / GS flag on the compiler, and also means that this is an overflow on the stack, not a bunch. I can also see the function that she attacked when she left, but I donโt see anything there that could cause this behavior, the function also existed for a long time (more than 10 years, although with some minor changes) and, as far as I know, this has never happened.
I would post the function code, but it is decently long and refers to many native functions / variables, etc.
Basically, Iโm looking for either some idea of โโwhat I should look for, which I donโt have, or some tools that can help. Unfortunately, almost every tool I found helps only when debugging overloads on the heap, and if I'm not mistaken, this is on the stack. Thanks in advance.
source share