Fix UBSAN report
/home/anoyes/workspace/foundationdb/fdbclient/SnapshotCache.h:44:10: runtime error: null pointer passed as argument 2, which is declared to never be null
This commit is contained in:
parent
560c1da805
commit
cc170fe8d8
|
@ -41,7 +41,9 @@ struct ExtStringRef {
|
|||
StringRef toArenaOrRef( Arena& a ) {
|
||||
if (extra_zero_bytes) {
|
||||
StringRef dest = StringRef( new(a) uint8_t[ size() ], size() );
|
||||
memcpy( mutateString(dest), base.begin(), base.size() );
|
||||
if (base.size()) {
|
||||
memcpy(mutateString(dest), base.begin(), base.size());
|
||||
}
|
||||
memset( mutateString(dest)+base.size(), 0, extra_zero_bytes );
|
||||
return dest;
|
||||
} else
|
||||
|
|
Loading…
Reference in New Issue