diff options
author | Caolán McNamara <caolanm@redhat.com> | 2021-09-05 15:07:23 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2021-09-05 20:48:58 +0200 |
commit | 148d2ffe35cae2fe758a3eb68ffd3ed81e2a8dd1 (patch) | |
tree | ad507fe857037030cadfbd101488aa801778be57 /vcl | |
parent | 996a259ce73d04686fe893f62480f59a641e2a5d (diff) |
ofz: MemorySanitizer: use-of-uninitialized-value
Change-Id: I3de2dd1032f0b43f484b67be0ba470ae08395e91
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121694
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/source/filter/imet/ios2met.cxx | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/vcl/source/filter/imet/ios2met.cxx b/vcl/source/filter/imet/ios2met.cxx index e767cccc047b..edf0bb95293f 100644 --- a/vcl/source/filter/imet/ios2met.cxx +++ b/vcl/source/filter/imet/ios2met.cxx @@ -1009,7 +1009,7 @@ void OS2METReader::ReadBitBlt() void OS2METReader::ReadChrStr(bool bGivenPos, bool bMove, bool bExtra, sal_uInt16 nOrderLen) { Point aP0; - sal_uInt16 i, nLen; + sal_uInt16 nLen; OSFont * pF; vcl::Font aFont; Size aSize; @@ -1043,10 +1043,10 @@ void OS2METReader::ReadChrStr(bool bGivenPos, bool bMove, bool bExtra, sal_uInt1 else nLen = nOrderLen-4; } - if (nLen > pOS2MET->remainingSize()) + if (!pOS2MET->good() || nLen > pOS2MET->remainingSize()) throw css::uno::Exception("attempt to read past end of input", nullptr); std::unique_ptr<char[]> pChr(new char[nLen+1]); - for (i=0; i<nLen; i++) + for (sal_uInt16 i=0; i<nLen; i++) pOS2MET->ReadChar( pChr[i] ); pChr[nLen] = 0; OUString aStr( pChr.get(), strlen(pChr.get()), osl_getThreadTextEncoding() ); |