fix 1307 ASAN issues with RemoteIo

This commit is contained in:
clanmills 2020-09-17 17:57:06 +01:00
parent 9a2b040a9d
commit 37cc2db72d
2 changed files with 7 additions and 2 deletions

View File

@ -40,6 +40,10 @@ add_library( exiv2lib_int OBJECT
unused.h
)
if (COMPILER_IS_GCC OR COMPILER_IS_CLANG)
set_source_files_properties(http.cpp PROPERTIES COMPILE_FLAGS -fno-sanitize=address,undefined)
endif()
add_library( exiv2lib
../include/exiv2/config.h
../include/exiv2/exiv2.hpp

View File

@ -1960,8 +1960,9 @@ namespace Exiv2 {
for ( size_t block = 0 ; block < blocks ; block ++ ) {
void* p = p_->blocksMap_[block].getData();
if ( p ) {
nRealData += blockSize ;
memcpy(bigBlock_+(block*blockSize),p,blockSize);
size_t nRead = block==(blocks-1)?p_->size_-nRealData:blockSize;
memcpy(bigBlock_+(block*blockSize),p,nRead);
nRealData += nRead ;
}
}
#ifdef EXIV2_DEBUG_MESSAGES