I'm looking for some real projects which have stack overflow vulnerabilities. The important thing is, I am going to teach finding the vulnerabilities and the way of fixing them by these examples. So, the vulnerabilities should be simple to find and simple to patch. Do you know any source code for this? Thank you.
Open Security Training has some great resources to teach developers about secure code practices including a virtual machine with compilers and vulnerable code samples
Also look at NIST's SAMATE TEST Suite for C and C++ vulnerable code, For e.g. C test suite contains good examples of Format String, Buffer overflow vulnerabilities in C.
You can find vulnerable versions of open source software like Wireshark on SAMATE as well. You might also want to look at exploit-db.com once your students are comfortable with simple vulnerabilities.
Finding security issues in Wireshark, VLC or any media libraries can be a great exercise for students and also improves security of open source projects.
DevIL is an image library with quite a lot of stack overflows in it.