hwpfilter/source/hbox.cxx |   15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

New commits:
commit 8b4b771edf6733d91b48ad2739fec9a2827bccf5
Author:     Caolán McNamara <caol...@redhat.com>
AuthorDate: Mon Feb 6 19:58:40 2023 +0000
Commit:     Michael Stahl <michael.st...@allotropia.de>
CommitDate: Tue Feb 7 10:33:33 2023 +0000

    ofz#55751 check that level is valid
    
    Change-Id: I971bdcc62fd3775f8f75bf69db41182afc4baefc
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146528
    Tested-by: Jenkins
    Reviewed-by: Michael Stahl <michael.st...@allotropia.de>

diff --git a/hwpfilter/source/hbox.cxx b/hwpfilter/source/hbox.cxx
index 983b522e91ba..52e5ab65369a 100644
--- a/hwpfilter/source/hbox.cxx
+++ b/hwpfilter/source/hbox.cxx
@@ -464,7 +464,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
@@ -479,7 +479,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)
@@ -604,12 +604,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:
                 {

Reply via email to