Fix occurrence of undefined behavior

UBSAN has this to say:

flow/Arena.h:982:10: runtime error: reference binding to null pointer of type 'KeyValueRef'

After this change UBSAN no longer complains about this occurrence
This commit is contained in:
Andrew Noyes 2019-11-26 21:34:24 -08:00
parent 8bc5574836
commit f320f6c174
1 changed files with 1 additions and 1 deletions

View File

@ -1156,7 +1156,7 @@ ACTOR Future<GetKeyValuesReply> readRange( StorageServer* data, Version version,
merge( result.arena, result.data, atStorageVersion, vStart, vEnd, vCount, limit, more, *pLimitBytes );
limit -= result.data.size() - prevSize;
for (auto i = &result.data[prevSize]; i != result.data.end(); i++)
for (auto i = result.data.begin() + prevSize; i != result.data.end(); i++)
*pLimitBytes -= sizeof(KeyValueRef) + i->expectedSize();
// Setup for the next iteration