Index: src/d8.cc |
diff --git a/src/d8.cc b/src/d8.cc |
index 94795cb8360f7d115099f8969e7ad043bc0575ba..4c6060b948849e3333ea96f4544b4f4a381e7bf4 100644 |
--- a/src/d8.cc |
+++ b/src/d8.cc |
@@ -1578,8 +1578,10 @@ SerializationTag SerializationData::ReadTag(int* offset) const { |
void SerializationData::ReadMemory(void* p, int length, int* offset) const { |
- memcpy(p, &data[*offset], length); |
- (*offset) += length; |
+ if (length > 0) { |
+ memcpy(p, &data[*offset], length); |
+ (*offset) += length; |
+ } |
} |