diff options
author | Caolán McNamara <caolanm@redhat.com> | 2021-02-16 20:27:40 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2021-02-17 12:18:29 +0100 |
commit | 93f7966140d71ac8a2489fa4cd5d88ba4d54620d (patch) | |
tree | c0003ae916099e4cf169f8a40dc9730c614063be /vcl | |
parent | 185ed8d270da6d41b1860b7afd74351098da14a0 (diff) |
ofz#31021 Stack-buffer-overflow
Conditional jump or move depends on uninitialised value(s)
at 0x483CB98: strlen (vg_replace_strmem.c:459)
by 0x49B4CA3: int rtl::str::getLength<char>(char const*) (strtmpl.hxx:65)
by 0x49B7232: void rtl::str::newFromStr<_rtl_String>(_rtl_String**,
rtl::str::STRCODE_DATA<_rtl_String>::type const*) (strtmpl.hxx:1344)
by 0x49B470C: rtl_string_newFromStr (string.cxx:611)
by 0x6059266: rtl::OString::OString<char [18]>(char (&)
[18], rtl::libreoffice_internal::NonConstCharArrayDetector<char [18],
rtl::libreoffice_internal::Dummy>::Type) (string.hxx:275)
by 0x6058B5E: vcl::GraphicFormatDetector::checkTGA() (GraphicFormatDetector.cxx:525)
since...
commit 48d655fe12bc2c4c42d6c88b8a43fade1614ee2a
Date: Mon Feb 15 16:25:56 2021 +0900
vcl: Detect TGA graphic by inspecting the file footer
Change-Id: I52641ac541d5631e16fc271c35d6a671acb75c93
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111006
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/source/filter/GraphicFormatDetector.cxx | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/vcl/source/filter/GraphicFormatDetector.cxx b/vcl/source/filter/GraphicFormatDetector.cxx index e5a1eb5f9a79..4a2117b6f5b9 100644 --- a/vcl/source/filter/GraphicFormatDetector.cxx +++ b/vcl/source/filter/GraphicFormatDetector.cxx @@ -522,8 +522,7 @@ bool GraphicFormatDetector::checkTGA() mrStream.SeekRel(-18); mrStream.ReadBytes(sFooterBytes, 18); - OString aFooterString(sFooterBytes); - if (aFooterString == "TRUEVISION-XFILE.") + if (memcmp(sFooterBytes, "TRUEVISION-XFILE.", SAL_N_ELEMENTS(sFooterBytes)) == 0) { msDetectedFormat = "TGA"; return true; |