From 06d045f457f0e9a34749dbb91323ce898a70c9d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kjist=C3=B3f?= Date: Sun, 23 Oct 2016 14:12:13 +0200 Subject: [PATCH] fixed overflow detection in StringValue::operator[] --- StringValue.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/StringValue.cpp b/StringValue.cpp index 26b8acf..90426ad 100644 --- a/StringValue.cpp +++ b/StringValue.cpp @@ -25,7 +25,7 @@ void StringValue::operator--() const char& StringValue::operator[](size_t index) const { - if (index > _size-1) + if (index > _size - 2) throw std::out_of_range("Index out of range!"); return _data[index]; }