Skip to content

Commit 6d7b851

Browse files
committed
Fix crash with HTML output and empty input (Issue #560)
1 parent e61ed3a commit 6d7b851

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

CHANGES.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ v1.9.24 - YYYY-MM-DD
77
- Updated the maximum image dimensions for RGBA images (Issue #557)
88
- Added/updated memory allocation checks (Issue #558)
99
- Updated error messages for consistency.
10+
- Fixed a crash bug when generating HTML output from empty HTML input files
11+
(Issue #560)
1012

1113

1214
v1.9.23 - 2026-01-28

htmldoc/html.cxx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1010,7 +1010,8 @@ static void
10101010
update_links(tree_t *t, /* I - Document tree */
10111011
uchar *filename) /* I - Current filename */
10121012
{
1013-
tree_t *doc = t->parent; /* Top of document */
1013+
tree_t *doc = t ? t->parent : NULL;
1014+
/* Top of document */
10141015
link_t *link; /* Link */
10151016
uchar *href; /* Reference name */
10161017
uchar newhref[1024]; /* New reference name */

htmldoc/htmlsep.cxx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1108,7 +1108,8 @@ static void
11081108
update_links(tree_t *t, // I - Document tree
11091109
int *heading) // I - Current heading
11101110
{
1111-
tree_t *doc = t->parent; // Top of document
1111+
tree_t *doc = t ? t->parent : NULL;
1112+
// Top of document
11121113
link_t *link; // Link
11131114
uchar *href; // Reference name
11141115
uchar newhref[1024]; // New reference name

0 commit comments

Comments
 (0)