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 c21fe962; for ; Wed, 11 Feb 2015 09:15:42 -0500 (EST) Date: Wed, 11 Feb 2015 09:15:42 -0500 (EST) Message-Id: <13822204771807575874.enqueue@fantadrom.bsd.lv> X-Mailinglist: mdocml-source Reply-To: source@mdocml.bsd.lv MIME-Version: 1.0 From: schwarze@mdocml.bsd.lv To: source@mdocml.bsd.lv Subject: mdocml: do not access a NULL pointer if an .Eo block lacks a tail; found X-Mailer: activitymail 1.26, http://search.cpan.org/dist/activitymail/ Content-Type: text/plain; charset=utf-8 Log Message: ----------- do not access a NULL pointer if an .Eo block lacks a tail; found by jsg@ with afl, test case #16 Modified Files: -------------- mdocml: mdoc_html.c mdoc_man.c mdoc_term.c Revision Data ------------- Index: mdoc_html.c =================================================================== RCS file: /home/cvs/mdocml/mdocml/mdoc_html.c,v retrieving revision 1.223 retrieving revision 1.224 diff -Lmdoc_html.c -Lmdoc_html.c -u -p -r1.223 -r1.224 --- mdoc_html.c +++ mdoc_html.c @@ -2220,9 +2220,8 @@ mdoc_eo_pre(MDOC_ARGS) n->child->end != ENDBODY_NOT) print_text(h, "\\&"); else if (n->end != ENDBODY_NOT ? n->child != NULL : - n->parent->head->child != NULL && - (n->parent->body->child != NULL || - n->parent->tail->child != NULL)) + n->parent->head->child != NULL && (n->child != NULL || + (n->parent->tail != NULL && n->parent->tail->child != NULL))) h->flags |= HTML_NOSPACE; return(1); } Index: mdoc_term.c =================================================================== RCS file: /home/cvs/mdocml/mdocml/mdoc_term.c,v retrieving revision 1.308 retrieving revision 1.309 diff -Lmdoc_term.c -Lmdoc_term.c -u -p -r1.308 -r1.309 --- mdoc_term.c +++ mdoc_term.c @@ -1989,9 +1989,8 @@ termp_eo_pre(DECL_ARGS) n->child->end != ENDBODY_NOT) term_word(p, "\\&"); else if (n->end != ENDBODY_NOT ? n->child != NULL : - n->parent->head->child != NULL && - (n->parent->body->child != NULL || - n->parent->tail->child != NULL)) + n->parent->head->child != NULL && (n->child != NULL || + (n->parent->tail != NULL && n->parent->tail->child != NULL))) p->flags |= TERMP_NOSPACE; return(1); Index: mdoc_man.c =================================================================== RCS file: /home/cvs/mdocml/mdocml/mdoc_man.c,v retrieving revision 1.85 retrieving revision 1.86 diff -Lmdoc_man.c -Lmdoc_man.c -u -p -r1.85 -r1.86 --- mdoc_man.c +++ mdoc_man.c @@ -1140,9 +1140,8 @@ pre_eo(DECL_ARGS) n->child->end != ENDBODY_NOT) print_word("\\&"); else if (n->end != ENDBODY_NOT ? n->child != NULL : - n->parent->head->child != NULL && - (n->parent->body->child != NULL || - n->parent->tail->child != NULL)) + n->parent->head->child != NULL && (n->child != NULL || + (n->parent->tail != NULL && n->parent->tail->child != NULL))) outflags &= ~(MMAN_spc | MMAN_nl); return(1); } -- To unsubscribe send an email to source+unsubscribe@mdocml.bsd.lv