diff options
Diffstat (limited to 'src/CellBuffer.cxx')
-rw-r--r-- | src/CellBuffer.cxx | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/CellBuffer.cxx b/src/CellBuffer.cxx index 3c11939f4..32cc9d730 100644 --- a/src/CellBuffer.cxx +++ b/src/CellBuffer.cxx @@ -11,6 +11,7 @@ #include <cstring> #include <cstdio> #include <cstdarg> +#include <climits> #include <stdexcept> #include <string> @@ -773,6 +774,9 @@ Sci::Position CellBuffer::Length() const noexcept { } void CellBuffer::Allocate(Sci::Position newSize) { + if (!largeDocument && (newSize > INT32_MAX)) { + throw std::runtime_error("CellBuffer::Allocate: size of standard document limited to 2G."); + } substance.ReAllocate(newSize); if (hasStyles) { style.ReAllocate(newSize); |