From: Emden Gansner Date: Thu, 22 Dec 2016 20:58:24 +0000 (-0500) Subject: Don't use aptr->u.asym unless it has been set. This can cause a crash if aptr->u... X-Git-Tag: 2.40.1~1 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9d4335bd4fd803497183f4a41c4102d34d4d4ffc;p=graphviz Don't use aptr->u.asym unless it has been set. This can cause a crash if aptr->u.asym->name is referenced. --- diff --git a/lib/cgraph/grammar.y b/lib/cgraph/grammar.y index 6d83a9f91..90aa27387 100644 --- a/lib/cgraph/grammar.y +++ b/lib/cgraph/grammar.y @@ -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