[Coverage] Fix coverage bug in which extra garbage is being written

Bug: 296356127

Change-Id: I2e4128af461b297bbe170c015dc52899089e9b8b
This commit is contained in:
Snehal 2024-04-30 14:31:14 +00:00 committed by Snehal Koukuntla
parent e451837298
commit 030dd05027

View file

@ -174,7 +174,7 @@ Result<void> CoverageRecord::SaveFile(const std::string& filename) {
}
uintptr_t* begin = (uintptr_t*)((char *)shm_ + sizeof(struct control));
bool ret = WriteFully(output_fd, begin, record_len_);
bool ret = WriteFully(output_fd, begin, record_len_ - sizeof(struct control));
if(!ret) {
fprintf(stderr, "Coverage write to file failed\n");
}