Skip to content

Commit

Permalink
bdlsb_overflowmemoutstreambuf: fix ubsan (#4954)
Browse files Browse the repository at this point in the history
  • Loading branch information
lalawawa authored and GitHub Enterprise committed Sep 16, 2024
1 parent 75a1143 commit 01fbfc1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion groups/bdl/bdlsb/bdlsb_overflowmemoutstreambuf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ void OverflowMemOutStreamBuf::grow(bsl::size_t numBytes)
char *newBuffer =
reinterpret_cast<char *>(d_allocator_p->allocate(newSize));

if (numBytes) {
if (numBytes && d_overflowBufferSize) {
bsl::memcpy(newBuffer, d_overflowBuffer_p, d_overflowBufferSize);
}
d_allocator_p->deallocate(d_overflowBuffer_p);
Expand Down

0 comments on commit 01fbfc1

Please sign in to comment.