From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from krisdoz.my.domain (schwarze@localhost [127.0.0.1]) by krisdoz.my.domain (8.14.5/8.14.5) with ESMTP id s47EEKtp023471 for ; Wed, 7 May 2014 10:14:20 -0400 (EDT) Received: (from schwarze@localhost) by krisdoz.my.domain (8.14.5/8.14.3/Submit) id s47EEHQ2030011; Wed, 7 May 2014 10:14:17 -0400 (EDT) Date: Wed, 7 May 2014 10:14:17 -0400 (EDT) Message-Id: <201405071414.s47EEHQ2030011@krisdoz.my.domain> 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 segfault in makewhatis -Q if the next .SH after .SH NAME X-Mailer: activitymail 1.26, http://search.cpan.org/dist/activitymail/ Content-Type: text/plain; charset=utf-8 Log Message: ----------- Do not segfault in makewhatis -Q if the next .SH after .SH NAME does not have any arguments. Crash found by nigel@ in kermit(1). Modified Files: -------------- mdocml: man.c Revision Data ------------- Index: man.c =================================================================== RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/man.c,v retrieving revision 1.129 retrieving revision 1.130 diff -Lman.c -Lman.c -u -p -r1.129 -r1.130 --- man.c +++ man.c @@ -595,9 +595,12 @@ man_pmacro(struct man *man, int ln, char /* In quick mode (for mandocdb), abort after the NAME section. */ - if (man->quick && MAN_SH == tok && - strcmp(man->last->prev->child->string, "NAME")) - return(2); + if (man->quick && MAN_SH == tok) { + n = man->last; + if (MAN_BODY == n->type && + strcmp(n->prev->child->string, "NAME")) + return(2); + } /* * We weren't in a block-line scope when entering the -- To unsubscribe send an email to source+unsubscribe@mdocml.bsd.lv