-
Notifications
You must be signed in to change notification settings - Fork 8
Open
Labels
bugSomething isn't workingSomething isn't working
Description
The following function accesses data[0] regardless of its size, so also if there are no bytes to write. This directly fails when bounds checking is enabled, but is otherwise UB and may lead to correct results since writing zero bytes of an invalid address can still work as expected.
template<typename T>
inline void RawBinaryAppendedWriter::writeData( std::ostream&,
const std::vector<T>& data )
{
HeaderType rawBytes = data.size( ) * sizeof( T );
appendedData.emplace_back( reinterpret_cast<const char*>( &data[0] ), rawBytes );
offset += sizeof( HeaderType ) + rawBytes;
}Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working