A stack-based buffer overflow existed in cscope's putstring function in cscope's versions prior to 15.6. A long function or symbol name in source code file could result in cscope crash or code execution when searching the source code for any function or symbol name.
Issue was originally reported via bug #189666, it can be reproduced using memcheck/tests/match-overrun.c from valgrind source tarball.
In cscope 15.6, putstring was replaced with function fetchstringfromdbase, which accepts target buffer size as its argument.
Upstream commit: http://cscope.cvs.sourceforge.net/viewvc/cscope/cscope/src/find.c?view=log#rev1.19
Patch, which was used in Fedora cscope packages and is used in cscope packages in Red Hat Enterprise Linux 5: http://cvs.fedoraproject.org/viewvc/rpms/cscope/devel/cscope-15.5-putstring-overflow.patch
Multiple buffer overflows in Cscope before 15.7a allow remote attackers to execute arbitrary code via long strings in input such as (1) source-code tokens and (2) pathnames, related to integer overflows in some cases. NOTE: this issue exists because of an incomplete fix for CVE-2004-2541.
main.c in cscope 15-4 and 15-5 creates temporary files with predictable filenames, which allows local users to overwrite arbitrary files via a symlink attack.