Kaydet (Commit) 1ebf34c6 authored tarafından Caolán McNamara's avatar Caolán McNamara

protect against short file

Change-Id: I20c6a6fb34485f42c2a828618e8918d8a441860a
Reviewed-on: https://gerrit.libreoffice.org/42389Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst 1cd8f0fa
...@@ -221,8 +221,7 @@ bool XMLFile2UTFConverter::scanForEncoding( Sequence< sal_Int8 > &seq ) ...@@ -221,8 +221,7 @@ bool XMLFile2UTFConverter::scanForEncoding( Sequence< sal_Int8 > &seq )
} }
// first level : detect possible file formats // 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 // scan for encoding
OString str( reinterpret_cast<const char *>(pSource), seq.getLength() ); OString str( reinterpret_cast<const char *>(pSource), seq.getLength() );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment