From b12fe7791044c2e773389f17338522a74b8f77f4 Mon Sep 17 00:00:00 2001 From: Michael Dietschi Date: Thu, 16 Mar 2017 07:19:19 +0100 Subject: [PATCH] Fix a possible OOB access when reading vector/matrix from configuration. --- src/Magnum/Math/RectangularMatrix.h | 2 +- src/Magnum/Math/Vector.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Magnum/Math/RectangularMatrix.h b/src/Magnum/Math/RectangularMatrix.h index 0e2c2ab3d..4881246ea 100644 --- a/src/Magnum/Math/RectangularMatrix.h +++ b/src/Magnum/Math/RectangularMatrix.h @@ -793,7 +793,7 @@ template struct ConfigurationValue< } oldpos = pos+1; - } while(pos != std::string::npos); + } while(pos != std::string::npos && i != cols*rows); return result; } diff --git a/src/Magnum/Math/Vector.h b/src/Magnum/Math/Vector.h index 38e38d583..0f17e44f5 100644 --- a/src/Magnum/Math/Vector.h +++ b/src/Magnum/Math/Vector.h @@ -1411,7 +1411,7 @@ template struct ConfigurationValue