Fix valgrind found error of reading uninitialized data
This commit is contained in:
parent
ee6490c9d1
commit
d73a19fea4
|
@ -32,7 +32,10 @@ public:
|
||||||
|
|
||||||
// For read() and write(), the data buffer must remain valid until the future is ready
|
// For read() and write(), the data buffer must remain valid until the future is ready
|
||||||
Future<int> read( void* data, int length, int64_t offset ) {
|
Future<int> read( void* data, int length, int64_t offset ) {
|
||||||
return map(m_f->read(data, length, offset), [=](int r) { updateChecksumHistory(false, offset, length, (uint8_t *)data); return r; });
|
return map(m_f->read(data, length, offset), [=](int r) {
|
||||||
|
updateChecksumHistory(false, offset, r, (uint8_t*)data);
|
||||||
|
return r;
|
||||||
|
});
|
||||||
}
|
}
|
||||||
Future<Void> readZeroCopy( void** data, int* length, int64_t offset ) {
|
Future<Void> readZeroCopy( void** data, int* length, int64_t offset ) {
|
||||||
return map(m_f->readZeroCopy(data, length, offset), [=](Void r) { updateChecksumHistory(false, offset, *length, (uint8_t *)data); return r; });
|
return map(m_f->readZeroCopy(data, length, offset), [=](Void r) { updateChecksumHistory(false, offset, *length, (uint8_t *)data); return r; });
|
||||||
|
|
Loading…
Reference in New Issue