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 888fd438 for ; Fri, 17 Mar 2017 07:10:46 -0500 (EST) Date: Fri, 17 Mar 2017 07:10:46 -0500 (EST) Message-Id: <54604146006546549.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: Fix regression in mdoc_html.c 1.275, man_html 1.134: For .Sh, X-Mailer: activitymail 1.26, http://search.cpan.org/dist/activitymail/ Content-Type: text/plain; charset=utf-8 Log Message: ----------- Fix regression in mdoc_html.c 1.275, man_html 1.134: For .Sh, .Ss, .SH, .SS, only write selflink if an id could be constructed. Crash reported by Raf Czlonka , analysis of root cause by natano@ Modified Files: -------------- mdocml: man_html.c mdoc_html.c Revision Data ------------- Index: man_html.c =================================================================== RCS file: /home/cvs/mdocml/mdocml/man_html.c,v retrieving revision 1.134 retrieving revision 1.135 diff -Lman_html.c -Lman_html.c -u -p -r1.134 -r1.135 --- man_html.c +++ man_html.c @@ -440,7 +440,8 @@ man_SH_pre(MAN_ARGS) if (n->type == ROFFT_HEAD) { id = html_make_id(n); print_otag(h, TAG_H1, "cTi", "Sh", id); - print_otag(h, TAG_A, "chR", "selflink", id); + if (id != NULL) + print_otag(h, TAG_A, "chR", "selflink", id); free(id); } return 1; @@ -509,7 +510,8 @@ man_SS_pre(MAN_ARGS) if (n->type == ROFFT_HEAD) { id = html_make_id(n); print_otag(h, TAG_H2, "cTi", "Ss", id); - print_otag(h, TAG_A, "chR", "selflink", id); + if (id != NULL) + print_otag(h, TAG_A, "chR", "selflink", id); free(id); } return 1; Index: mdoc_html.c =================================================================== RCS file: /home/cvs/mdocml/mdocml/mdoc_html.c,v retrieving revision 1.277 retrieving revision 1.278 diff -Lmdoc_html.c -Lmdoc_html.c -u -p -r1.277 -r1.278 --- mdoc_html.c +++ mdoc_html.c @@ -501,7 +501,8 @@ mdoc_sh_pre(MDOC_ARGS) case ROFFT_HEAD: id = html_make_id(n); print_otag(h, TAG_H1, "cTi", "Sh", id); - print_otag(h, TAG_A, "chR", "selflink", id); + if (id != NULL) + print_otag(h, TAG_A, "chR", "selflink", id); free(id); break; case ROFFT_BODY: @@ -524,7 +525,8 @@ mdoc_ss_pre(MDOC_ARGS) id = html_make_id(n); print_otag(h, TAG_H2, "cTi", "Ss", id); - print_otag(h, TAG_A, "chR", "selflink", id); + if (id != NULL) + print_otag(h, TAG_A, "chR", "selflink", id); free(id); return 1; } -- To unsubscribe send an email to source+unsubscribe@mdocml.bsd.lv