| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent c0dd022 commit 74a22cd
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1567,6 +1567,10 @@ void CopyArrayBuffer(const FunctionCallbackInfo<Value>& args) { | |||
| 1567 | 1567 | uint32_t source_offset = args[3].As<Uint32>()->Value(); | |
| 1568 | 1568 | size_t bytes_to_copy = args[4].As<Uint32>()->Value(); | |
| 1569 | 1569 | ||
| 1570 | + // Assert the offsets are within bounds before the subtractions below, which | ||
| 1571 | + // would otherwise underflow and defeat the bytes_to_copy bounds checks. | ||
| 1572 | + CHECK_LE(destination_offset, destination_byte_length); | ||
| 1573 | + CHECK_LE(source_offset, source_byte_length); | ||
| 1570 | 1574 | CHECK_GE(destination_byte_length - destination_offset, bytes_to_copy); | |
| 1571 | 1575 | CHECK_GE(source_byte_length - source_offset, bytes_to_copy); | |
| 1572 | 1576 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments