From bac57f75cd18472167742e804d789ffbc43fa9a9 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Sat, 20 Jul 2019 15:14:06 +0100 Subject: cid#1448305 silence Out-of-bounds access MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I7a25cc0c30f06ec146bdc205c51d5cad70e713b1 Reviewed-on: https://gerrit.libreoffice.org/76014 Tested-by: Jenkins Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara --- xmloff/source/style/XMLFontAutoStylePool.cxx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'xmloff/source') diff --git a/xmloff/source/style/XMLFontAutoStylePool.cxx b/xmloff/source/style/XMLFontAutoStylePool.cxx index d16997977f10..b89525f75442 100644 --- a/xmloff/source/style/XMLFontAutoStylePool.cxx +++ b/xmloff/source/style/XMLFontAutoStylePool.cxx @@ -617,7 +617,7 @@ OUString XMLFontAutoStylePool::embedFontFile(OUString const & fileUrl, OUString propertySet->setPropertyValue( "MediaType", uno::makeAny( OUString( "application/x-font-ttf" ))); // TODO for(;;) { - char buffer[ 4096 ]; + sal_Int8 buffer[ 4096 ]; sal_uInt64 readSize; sal_Bool eof; if( file.isEndOfFile( &eof ) != osl::File::E_None ) @@ -636,7 +636,8 @@ OUString XMLFontAutoStylePool::embedFontFile(OUString const & fileUrl, OUString } if( readSize == 0 ) break; - outputStream->writeBytes( uno::Sequence< sal_Int8 >( reinterpret_cast< const sal_Int8* >( buffer ), readSize )); + // coverity[overrun-buffer-arg : FALSE] - coverity has difficulty with css::uno::Sequence + outputStream->writeBytes(uno::Sequence(buffer, readSize)); } outputStream->closeOutput(); if( storage.is() ) -- cgit