diff options
-rw-r--r-- | starmath/source/smdetect.cxx | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/starmath/source/smdetect.cxx b/starmath/source/smdetect.cxx index 6b316f19e169..6deea78d0c2f 100644 --- a/starmath/source/smdetect.cxx +++ b/starmath/source/smdetect.cxx @@ -91,12 +91,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 auto nBytesRead = pInStrm->ReadBytes( aBuffer, nBufferSize ); if (nBytesRead >= 6) { + aBuffer[nBytesRead] = 0; bool bIsMathType = false; if (0 == strncmp( "<?xml", aBuffer, 5)) bIsMathType = (strstr( aBuffer, "<math>" ) || |