diff options
author | Ingo Schwarze <schwarze@openbsd.org> | 2017-03-17 12:10:16 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@openbsd.org> | 2017-03-17 12:10:16 +0000 |
commit | 6f690198d639784695f202701c693bd56db57eb7 (patch) | |
tree | 156371d71a054c6641858613bb5fd7ab0ee8f2e2 /man_html.c | |
parent | 0f790e66e278261421be6bb2b1285564f929469a (diff) | |
download | mandoc-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.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -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; |