We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1c7c271 commit 1ef2165Copy full SHA for 1ef2165
system/lib/wasmfs/backends/memory_backend.cpp
@@ -15,6 +15,11 @@ namespace wasmfs {
15
16
ssize_t MemoryDataFile::write(const uint8_t* buf, size_t len, off_t offset) {
17
if (offset + len > buffer.size()) {
18
+ if (offset + len > buffer.max_size()) {
19
+ // Overflow: the necessary size fits in an off_t, but cannot fit in the
20
+ // container.
21
+ return -EIO;
22
+ }
23
buffer.resize(offset + len);
24
}
25
std::memcpy(&buffer[offset], buf, len);
0 commit comments