tags 550092 + patch
stop

The attached patch fixes the bug.


diff -ruN orig/dia2code-0.8.3/dia2code/parse_diagram.c dia2code-0.8.3/dia2code/parse_diagram.c
--- orig/dia2code-0.8.3/dia2code/parse_diagram.c	2003-03-05 17:44:38.000000000 +0100
+++ dia2code-0.8.3/dia2code/parse_diagram.c	2010-04-24 16:18:25.000000000 +0200
@@ -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 {

Reply via email to