hwpfilter/source/hbox.cxx | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-)
New commits: commit ca57cee2ae5718378193a9c7050248c63b5fa47e Author: Caolán McNamara <caol...@redhat.com> AuthorDate: Mon Feb 6 19:58:40 2023 +0000 Commit: Caolán McNamara <caol...@redhat.com> CommitDate: Tue Feb 7 09:32:59 2023 +0000 ofz#55751 check that level is valid Change-Id: I971bdcc62fd3775f8f75bf69db41182afc4baefc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146595 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caol...@redhat.com> diff --git a/hwpfilter/source/hbox.cxx b/hwpfilter/source/hbox.cxx index 16236bb8fc41..b498fa31cfbb 100644 --- a/hwpfilter/source/hbox.cxx +++ b/hwpfilter/source/hbox.cxx @@ -467,7 +467,7 @@ static hchar olHanglJaso(int num, int type) static const hchar *GetOutlineStyleChars(int style) { - static const hchar out_bul_style_entry[5][8] = // extern + static const hchar out_bul_style_entry[5][MAX_OUTLINE_LEVEL+1] = // extern { { // 0 OLSTY_BULLET1 0x2f18, 0x2f12, 0x2f08, 0x2f02, 0x2f06, 0x2f00, 0x2043, 0x0000 @@ -482,7 +482,7 @@ static const hchar *GetOutlineStyleChars(int style) 0x2f18, 0x2f16, 0x2f12, 0x2f10, 0x2f06, 0x2f00, 0x2043, 0x0000 }, { - 0xAC61, 0xB677, 0xB861, 0xB8F7, 0xB781, 0x0000 + 0xAC61, 0xB677, 0xB861, 0xB8F7, 0xB781, 0x0000, 0x0000, 0x0000 }, }; if (style >= OLSTY_BULLET1 && style <= OLSTY_BULLET5) @@ -605,12 +605,15 @@ OUString Outline::GetUnicode() const case OLSTY_BULLET3: case OLSTY_BULLET4: case OLSTY_BULLET5: + { + if (level < MAX_OUTLINE_LEVEL) { - p = GetOutlineStyleChars(shape); - buffer[0] = p[level]; - buffer[1] = 0; - return hstr2OUString(buffer); + p = GetOutlineStyleChars(shape); + buffer[0] = p[level]; + buffer[1] = 0; } + return hstr2OUString(buffer); + } case OLSTY_USER: case OLSTY_BULUSER: {