Skip to content

Commit 65a0f75

Browse files
Irina YatsenkoCommit Bot
authored andcommitted
Guard against overflow in CopyImpl if requested count is zero
Bug: v8:9739 Change-Id: I6ec23018e6e2725e47efcc9a5d95dda3713d064e Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1803792 Commit-Queue: Irina Yatsenko <irinayat@microsoft.com> Reviewed-by: Ulan Degenbaev <ulan@chromium.org> Cr-Commit-Position: refs/heads/master@{#63812}
1 parent 0999cfb commit 65a0f75

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

src/utils/memcopy.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ inline void CopyImpl(T* dst_ptr, const T* src_ptr, size_t count) {
109109
DCHECK(((src <= dst) && ((src + count * kTWordSize) <= dst)) ||
110110
((dst <= src) && ((dst + count * kTWordSize) <= src)));
111111
#endif
112+
if (count == 0) return;
112113

113114
// Use block copying MemCopy if the segment we're copying is
114115
// enough to justify the extra call/setup overhead.

0 commit comments

Comments
 (0)