Skip to content

Commit

Permalink
fix(dwio): Buffer corruption when new capacity is less than old size
Browse files Browse the repository at this point in the history
  • Loading branch information
nmahadevuni committed Mar 11, 2025
1 parent c2eb47b commit 876d78a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion velox/dwio/common/BufferUtil.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ inline void ensureCapacity(
}
}

if (clearBits) {
if (clearBits && capacity > oldSize) {
std::memset(
(void*)(data->asMutable<int8_t>() + oldSize), 0L, capacity - oldSize);
}
Expand Down

0 comments on commit 876d78a

Please sign in to comment.