Skip to content

Commit

Permalink
fix(dwio): Buffer corruption when requested capacity is smaller than …
Browse files Browse the repository at this point in the history
…existing size
  • Loading branch information
nmahadevuni committed Mar 11, 2025
1 parent c2eb47b commit fe6a12a
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 fe6a12a

Please sign in to comment.