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>
This commit is contained in:
Caolán McNamara 2022-12-19 21:19:40 +00:00
parent bb692dd15d
commit f6b4c3fb68

View file

@ -616,7 +616,7 @@ OUString Outline::GetUnicode() const
char dest[80]; char dest[80];
int l = 0; int l = 0;
unsigned i = level; unsigned i = level;
if( deco[i][0] ){ if (i < std::size(deco) && deco[i][0]) {
buffer[l++] = deco[i][0]; buffer[l++] = deco[i][0];
} }
if (i < std::size(user_shape)) if (i < std::size(user_shape))
@ -690,7 +690,7 @@ OUString Outline::GetUnicode() const
break; break;
} }
} }
if( deco[i][1] ){ if (i < std::size(deco) && deco[i][1]) {
buffer[l++] = deco[i][1]; buffer[l++] = deco[i][1];
} }
buffer[l] = 0; buffer[l] = 0;