tags:

views:

123

answers:

3

As I code, I try to be security-conscious all the time. The problem is that I need to know what to look for and what to prevent.

Is there a list somewhere of the most common (C++) software vulnerabilities and how to avoid them?

What about C++ software for specific uses, e.g. a linux console software or a web application?

+4  A: 

This site may have links to what you are looking for:

http://www.deitel.com/ResourceCenters/Programming/C/CSecurity/tabid/1549/Default.aspx


I guess I'll add that one of the most common problems in C and C++ is buffer overflow:

http://en.wikipedia.org/wiki/Buffer_overflow#Use_of_safe_libraries

For that, use only functions that check boundaries, like strncpy() instead of strcpy().

chrisaycock
That's a really helpful link
Nahar
Thank you. I'm studying these links.
augustin
`strncpy` is a *bad* idea because it can leave you without null-terminated strings, leading to even worse buffer overflows. Alternatives like `strlcpy`, `strcpy_s`, and `memcpy` are better.
Gabe
+5  A: 

Many resources are available, some in question are:

birryree
Thank you. Those are good resources. The Linux book is especially useful to me. Thanks.
augustin
+1  A: 

There are also problems such as 1. Segmentation Fault 2. Memory Leak 3. Memory Allocation errors, etc that might be of your concern...

1s2a3n4j5e6e7v