summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2022-12-19 21:19:40 +0000
committerCaolán McNamara <caolanm@redhat.com>2022-12-20 08:22:07 +0000
commitf6b4c3fb68f9b36e1e64fc4a4c680ab1bb7fb013 (patch)
tree99c8a170f2d3b6d054aedde5fa4b36323561cb98
parentbb692dd15d3c32e85f193c3f60c7917f2b1e13d2 (diff)
cid#1517796 Out-of-bounds read
Change-Id: I930e3888cfa3363b9183619225f0d4cdca197cdd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144547 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r--hwpfilter/source/hbox.cxx4
1 files changed, 2 insertions, 2 deletions
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;