summaryrefslogtreecommitdiff
path: root/starmath
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2017-09-17 14:22:45 +0100
committerAndras Timar <andras.timar@collabora.com>2017-09-18 17:50:30 +0200
commitd72bff5dabc03b35e48f0eb7ca4ab18b2403af05 (patch)
tree04cea0668ac2097b472c54d56a68235ba36b7e60 /starmath
parent253fe62c5b736bfd46106d510356e0809a44b02a (diff)
valgrind: Conditional jump or move depends on uninitialised value
Conditional jump or move depends on uninitialised value(s) at 0x4C3535E: strstr (vg_replace_strmem.c:1623) by 0x4FCD9E59: SmFilterDetect::detect(com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue>&) (smdetect.cxx:102) by 0x41A1A774: filter::config::TypeDetection::impl_askDetectService(rtl::OUString const&, utl::MediaDescriptor&) (typedetection.cxx:1038) Change-Id: I2f98fd3f7799f34cb5bd9242379ce6440645034d Reviewed-on: https://gerrit.libreoffice.org/42381 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com> (cherry picked from commit 64aa36e8b999ea4dcad69904da941705effad618) Reviewed-on: https://gerrit.libreoffice.org/42387 Reviewed-by: Michael Stahl <mstahl@redhat.com> (cherry picked from commit 256a405d4b1feeafd8a09e98bce9fb0c9125ee3d)
Diffstat (limited to 'starmath')
-rw-r--r--starmath/source/smdetect.cxx2
1 files changed, 1 insertions, 1 deletions
diff --git a/starmath/source/smdetect.cxx b/starmath/source/smdetect.cxx
index 18dfa736bd51..91c8733bf13c 100644
--- a/starmath/source/smdetect.cxx
+++ b/starmath/source/smdetect.cxx
@@ -93,12 +93,12 @@ OUString SAL_CALL SmFilterDetect::detect( Sequence< PropertyValue >& lDescriptor
// stuff I hope?
static const sal_uInt16 nBufferSize = 200;
char aBuffer[nBufferSize+1];
- aBuffer[nBufferSize] = 0;
pInStrm->Seek( STREAM_SEEK_TO_BEGIN );
pInStrm->StartReadingUnicodeText( RTL_TEXTENCODING_DONTKNOW ); // avoid BOM marker
sal_uLong nBytesRead = pInStrm->ReadBytes( aBuffer, nBufferSize );
if (nBytesRead >= 6)
{
+ aBuffer[nBytesRead] = 0;
bool bIsMathType = false;
if (0 == strncmp( "<?xml", aBuffer, 5))
bIsMathType = (strstr( aBuffer, "<math>" ) ||