hwpfilter/source/hbox.cxx |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 44db73a3e37a22fe0af4828c0164c27724fd761d
Author:     Caolán McNamara <[email protected]>
AuthorDate: Mon Dec 19 21:19:40 2022 +0000
Commit:     Caolán McNamara <[email protected]>
CommitDate: Tue Dec 20 08:22:15 2022 +0000

    cid#1517796 Out-of-bounds read
    
    Change-Id: I930e3888cfa3363b9183619225f0d4cdca197cdd
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144515
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <[email protected]>

diff --git a/hwpfilter/source/hbox.cxx b/hwpfilter/source/hbox.cxx
index 2e43d0f19691..acf6770ec9ba 100644
--- a/hwpfilter/source/hbox.cxx
+++ b/hwpfilter/source/hbox.cxx
@@ -616,7 +616,7 @@ OUString Outline::GetUnicode() const
                     char dest[80];
                     int l = 0;
                     unsigned i = level;
-                    if( deco[i][0] ){
+                    if (i < std::size(deco) && deco[i][0]) {
                         buffer[l++] = deco[i][0];
                     }
                     if (i < std::size(user_shape))
@@ -690,7 +690,7 @@ OUString Outline::GetUnicode() const
                                 break;
                         }
                     }
-                    if( deco[i][1] ){
+                    if (i < std::size(deco) && deco[i][1]) {
                         buffer[l++] = deco[i][1];
                     }
                     buffer[l] = 0;

Reply via email to