summaryrefslogtreecommitdiffstats
path: root/man_html.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2017-03-17 12:10:16 +0000
committerIngo Schwarze <schwarze@openbsd.org>2017-03-17 12:10:16 +0000
commit6f690198d639784695f202701c693bd56db57eb7 (patch)
tree156371d71a054c6641858613bb5fd7ab0ee8f2e2 /man_html.c
parent0f790e66e278261421be6bb2b1285564f929469a (diff)
downloadmandoc-6f690198d639784695f202701c693bd56db57eb7.tar.gz
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 <rczlonka at gmail dot com>, analysis of root cause by natano@
Diffstat (limited to 'man_html.c')
-rw-r--r--man_html.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/man_html.c b/man_html.c
index cc3fc761..6ec12bb3 100644
--- a/man_html.c
+++ b/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;