From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from localhost (fantadrom.bsd.lv [local]) by fantadrom.bsd.lv (OpenSMTPD) with ESMTPA id 71b593fc for ; Fri, 19 Apr 2019 23:15:36 -0500 (EST) Date: Fri, 19 Apr 2019 23:15:36 -0500 (EST) X-Mailinglist: mandoc-source Reply-To: source@mandoc.bsd.lv MIME-Version: 1.0 From: schwarze@mandoc.bsd.lv To: source@mandoc.bsd.lv Subject: docbook2mdoc: do not crash by trying to insert an attribute into a X-Mailer: activitymail 1.26, http://search.cpan.org/dist/activitymail/ Content-Type: text/plain; charset=utf-8 Message-ID: Log Message: ----------- do not crash by trying to insert an attribute into a non-existent node; segfault reported by Stephen Gregoratto Modified Files: -------------- docbook2mdoc: parse.c Revision Data ------------- Index: parse.c =================================================================== RCS file: /home/cvs/mdocml/docbook2mdoc/parse.c,v retrieving revision 1.46 retrieving revision 1.47 diff -Lparse.c -Lparse.c -u -p -r1.46 -r1.47 --- parse.c +++ parse.c @@ -553,7 +553,7 @@ xml_attrkey(struct parse *p, const char const char *value; enum attrkey key; - if (p->del > 0 || p->ncur == NODE_IGNORE || *name == '\0') + if (p->del > 0 || p->ncur >= NODE_UNKNOWN || *name == '\0') return; if ((p->ncur == NODE_DOCTYPE || p->ncur == NODE_ENTITY) && @@ -590,7 +590,7 @@ xml_attrval(struct parse *p, const char { struct pattr *a; - if (p->del > 0 || p->ncur == NODE_IGNORE || + if (p->del > 0 || p->ncur >= NODE_UNKNOWN || (p->flags & PFLAG_ATTR) == 0) return; if ((a = TAILQ_LAST(&p->cur->attrq, pattrq)) == NULL) -- To unsubscribe send an email to source+unsubscribe@mandoc.bsd.lv