1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
|
Description: Fix segmentation fault with big UML packages
Author: Francesco Aloe <francescoaloe4gnulinux@gmail.com>
Forwarded: not-needed
Last-Update: 2010-04-24
diff -ruN orig/dia2code-0.8.3/dia2code/parse_diagram.c dia2code-0.8.3/dia2code/parse_diagram.c
@@ -384,6 +384,10 @@
attribute = package->xmlChildrenNode;
while ( attribute != NULL ) {
attrname = xmlGetProp(attribute, "name");
+ if( attrname == NULL ) {
+ attribute = attribute->next;
+ continue;
+ }
if ( ! strcmp("name", attrname) ) {
parse_dia_string(attribute->xmlChildrenNode, myself->name);
} else if ( ! strcmp ( "obj_pos", attrname ) ) {
@@ -418,6 +422,10 @@
attribute = class->xmlChildrenNode;
while ( attribute != NULL ) {
attrname = xmlGetProp(attribute, "name");
+ if( attrname == NULL ) {
+ attribute = attribute->next;
+ continue;
+ }
if ( ! strcmp("name", attrname) ) {
parse_dia_string(attribute->xmlChildrenNode, myself->name);
} else if ( ! strcmp ( "obj_pos", attrname ) ) {
@@ -478,7 +486,7 @@
id = xmlGetProp(attribute->xmlChildrenNode, "to");
} else {
attrname = xmlGetProp(attribute, "name");
- if ( ! strcmp("text", attrname) && attribute->xmlChildrenNode != NULL &&
+ if ( attrname != NULL && ! strcmp("text", attrname) && attribute->xmlChildrenNode != NULL &&
attribute->xmlChildrenNode->xmlChildrenNode != NULL ){
name = attribute->xmlChildrenNode->xmlChildrenNode->content;
} else {
|