diff options
| author | Neil Hodgson <nyamatongwe@gmail.com> | 2015-07-04 08:51:08 +1000 |
|---|---|---|
| committer | Neil Hodgson <nyamatongwe@gmail.com> | 2015-07-04 08:51:08 +1000 |
| commit | 6383d824ceff7d6b3c16dd7c71747f36089c16ad (patch) | |
| tree | 1d110edcc481e6bb87aa608920c0d3453674812b | |
| parent | b251de96975a3894a450d9e0e7be0ad769e533b3 (diff) | |
| download | scintilla-mirror-6383d824ceff7d6b3c16dd7c71747f36089c16ad.tar.gz | |
Throw an exception for a negative sized reallocation as occurs when asked
for more than 2GB.
| -rw-r--r-- | src/ContractionState.cxx | 1 | ||||
| -rw-r--r-- | src/Decoration.cxx | 1 | ||||
| -rw-r--r-- | src/SplitVector.h | 3 |
3 files changed, 5 insertions, 0 deletions
diff --git a/src/ContractionState.cxx b/src/ContractionState.cxx index 7b7655420..16ca3c531 100644 --- a/src/ContractionState.cxx +++ b/src/ContractionState.cxx @@ -7,6 +7,7 @@ #include <string.h> +#include <stdexcept> #include <algorithm> #include "Platform.h" diff --git a/src/Decoration.cxx b/src/Decoration.cxx index e7610e0b6..042ffcacb 100644 --- a/src/Decoration.cxx +++ b/src/Decoration.cxx @@ -9,6 +9,7 @@ #include <stdio.h> #include <stdarg.h> +#include <stdexcept> #include <algorithm> #include "Platform.h" diff --git a/src/SplitVector.h b/src/SplitVector.h index 288c9e39f..3153700f5 100644 --- a/src/SplitVector.h +++ b/src/SplitVector.h @@ -85,6 +85,9 @@ public: /// copy exisiting contents to the new buffer. /// Must not be used to decrease the size of the buffer. void ReAllocate(int newSize) { + if (newSize < 0) + throw std::runtime_error("SplitVector::ReAllocate: negative size."); + if (newSize > size) { // Move the gap to the end GapTo(lengthBody); |
