From 74d9124c5dfc7983f643e6117f7837adcd25dc6a Mon Sep 17 00:00:00 2001 From: Kevin Lin Date: Wed, 3 Feb 2016 12:04:58 -0500 Subject: [PATCH] hwp3.x: fix issue in footnote/endnote handler --- libclamav/hwp.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/libclamav/hwp.c b/libclamav/hwp.c index 5dcae38f1..16741a4f8 100644 --- a/libclamav/hwp.c +++ b/libclamav/hwp.c @@ -1160,9 +1160,9 @@ static inline int parsehwp3_paragraph(cli_ctx *ctx, fmap_t *map, int p, int leve return ret; break; } - case 17: /* footnote/North America??? */ + case 17: /* footnote/endnote */ { - hwp3_debug("HWP3.x: Detected hidden description marker @ offset %llu\n", (long long unsigned)offset); + hwp3_debug("HWP3.x: Detected footnote/endnote marker @ offset %llu\n", (long long unsigned)offset); /* * offset 0 (2 bytes) - special character ID @@ -1179,6 +1179,13 @@ static inline int parsehwp3_paragraph(cli_ctx *ctx, fmap_t *map, int p, int leve HWP3_PSPECIAL_VERIFY(map, offset, 6, content, match); offset += 22; + + /* content paragraph list */ + hwp3_debug("HWP3.x: Paragraph[%d, %d]: footnote/endnote paragraph list starts @ %llu\n", level, p, (long long unsigned)offset); + l = 0; + while (!l && ((ret = parsehwp3_paragraph(ctx, map, sp++, level+1, &offset, &l)) == CL_SUCCESS)); + if (ret != CL_SUCCESS) + return ret; break; } case 18: /* paste code number */