• Advertisement
Sign in to follow this  

program to detect buffer overruns in c++

This topic is 4803 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

are there any free pograms that will work with visual c++ .NET to detect buffer overruns. Actually, even if it was just a free trial that would be okay. Any suggestions.

Share this post


Link to post
Share on other sites
Advertisement
of course!
The .NET compiler itself :)

The /GS Option
The new /GS compile-time option adds special data (a cookie) to the stack between the local data and the return address. The startup code for a process or dynamic link library (DLL) determines and assigns a random value for the cookie. When the function returns (often referred to as function epilog), the compiler checks the cookie; if it has changed, then it calls a default error handler function that halts the process. Stopping the application is better than risking an attack.



Setting this option is simple; just follow these steps from within your Visual C++.NET project:

Open the project's Property Pages dialog box.

Click the C/C++ folder.

Click the Code Generation property page.

Set the Buffer Security Check property to Yes (/GS).

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement