diff options
Diffstat (limited to 'sax')
-rw-r--r-- | sax/source/expatwrap/xml2utf.cxx | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/sax/source/expatwrap/xml2utf.cxx b/sax/source/expatwrap/xml2utf.cxx index fde25ce8482b..58ee36c1c829 100644 --- a/sax/source/expatwrap/xml2utf.cxx +++ b/sax/source/expatwrap/xml2utf.cxx @@ -221,8 +221,7 @@ bool XMLFile2UTFConverter::scanForEncoding( Sequence< sal_Int8 > &seq ) } // first level : detect possible file formats - if( ! strncmp( reinterpret_cast<const char *>(pSource), "<?xml", 5 ) ) { - + if (seq.getLength() >= 5 && !strncmp(reinterpret_cast<const char *>(pSource), "<?xml", 5)) { // scan for encoding OString str( reinterpret_cast<const char *>(pSource), seq.getLength() ); |