]> granicus.if.org Git - graphviz/commitdiff
Don't use aptr->u.asym unless it has been set. This can cause a crash if aptr->u...
authorEmden Gansner <emdenrg@google.com>
Thu, 22 Dec 2016 20:58:24 +0000 (15:58 -0500)
committerEmden Gansner <emdenrg@google.com>
Thu, 22 Dec 2016 20:58:24 +0000 (15:58 -0500)
lib/cgraph/grammar.y

index 6d83a9f91179999d1fcc3debf82ebb8168542d91..90aa27387100330692861912636fe241b83809b7 100644 (file)
@@ -352,6 +352,8 @@ static void attrstmt(int tkind, char *macroname)
        }
        bindattrs(kind);        /* set up defaults for new attributes */
        for (aptr = S->attrlist.first; aptr; aptr = aptr->next) {
+               /* If the tag is still T_atom, aptr->u.asym has not been set */
+               if (aptr->tag == T_atom) continue;
                if (!(aptr->u.asym->fixed) || (S->g != G))
                        sym = agattr(S->g,kind,aptr->u.asym->name,aptr->str);
                else