How to disable buffer overflow checking in the Visual C++ Runtime? How to disable buffer overflow checking in the Visual C++ Runtime? windows windows

How to disable buffer overflow checking in the Visual C++ Runtime?


There is an option here. Set it to no.

Project Properties -> Configuration Properties -> C/C++ -> Code Generation -> Buffer Security Check.

This corresponds to the /GS (Buffer Security Check) compiler option:

Detects some buffer overruns that overwrite the return address, a common technique for exploiting code that does not enforce buffer size restrictions. This is achieved by injecting security checks into the compiled code.


Is this happening in you code or actually in the library? If it's in the library, I know you say you want to just ignore the error, but what you would you do if it was an access violation that crashed the process?

You should treat it the same way, because logically it's the same thing. It's just the CRT is crashing the process instead of the OS.

But, If you're using the debug build of the library you might get better (?) results using the release build (maybe it'll just crash without the dialog box notification).

If it's in your code you can disable the overflow check using the /GS- option. But you should really fix the bug.