aboutsummaryrefslogtreecommitdiff
path: root/src/bun.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/bun.js')
-rw-r--r--src/bun.js/bindings/JSBuffer.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/bun.js/bindings/JSBuffer.cpp b/src/bun.js/bindings/JSBuffer.cpp
index e420e24ef..26047aa3d 100644
--- a/src/bun.js/bindings/JSBuffer.cpp
+++ b/src/bun.js/bindings/JSBuffer.cpp
@@ -949,7 +949,8 @@ static inline JSC::EncodedJSValue jsBufferPrototypeFunction_copyBody(JSC::JSGlob
}
targetStart = std::min(targetStart, targetEnd);
- sourceStart = std::min(sourceStart, std::min(sourceEnd, sourceEndInit));
+ sourceEnd = std::min(sourceEnd, sourceEndInit);
+ sourceStart = std::min(sourceStart, sourceEnd);
auto sourceLength = sourceEnd - sourceStart;
auto targetLength = targetEnd - targetStart;