Fix for buffer overflow when using large %feature(docstring) reported by Joseph Winston

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@9155 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
William S Fulton 2006-06-12 21:10:25 +00:00
commit da0b5cf884

View file

@ -4014,12 +4014,12 @@ cpp_destructor_decl : NOT idtemplate LPAREN parms RPAREN cpp_end {
| VIRTUAL NOT idtemplate LPAREN parms RPAREN cpp_vend {
String *name;
char *c;
char *c = 0;
$$ = new_node("destructor");
/* Check for template names. If the class is a template
and the constructor is missing the template part, we
add it */
if ((c = strstr(Char(Classprefix),"<"))) {
if (Classprefix && (c = strstr(Char(Classprefix),"<"))) {
if (!Strstr($3,"<")) {
$3 = NewStringf("%s%s",$3,c);
}