diff options
author | Caolán McNamara <caolanm@redhat.com> | 2023-02-06 19:58:40 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2023-02-07 09:32:59 +0000 |
commit | ca57cee2ae5718378193a9c7050248c63b5fa47e (patch) | |
tree | da1eaba8ea9ac257dcbf4ca0dfd6efe0cf13ff9a | |
parent | 9259f79517bec3e7ebbc423eca098694fbf2a079 (diff) |
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 <caolanm@redhat.com>
-rw-r--r-- | hwpfilter/source/hbox.cxx | 15 |
1 files changed, 9 insertions, 6 deletions
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: { |