summaryrefslogtreecommitdiff
path: root/sax/source/expatwrap/xml2utf.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sax/source/expatwrap/xml2utf.cxx')
-rw-r--r--sax/source/expatwrap/xml2utf.cxx3
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() );