From f330fffa09dd1cdf9d6e1e42f8705d43d5803e85 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Fri, 26 Sep 2014 04:15:25 +0200 Subject: Test maximum rotation value in map loader --- src/model/Map.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/model/Map.cpp b/src/model/Map.cpp index ac0b6ee..ee413cf 100644 --- a/src/model/Map.cpp +++ b/src/model/Map.cpp @@ -117,7 +117,7 @@ std::unique_ptr Map::load(__attribute__((unused)) const std::string &name) unsigned rot; char *tile = nullptr; - if (std::sscanf(line.c_str(), "%c %u %ms", &c, &rot, &tile) != 3) { + if (std::sscanf(line.c_str(), "%c %u %ms", &c, &rot, &tile) != 3 || rot >= 4) { std::free(tile); throw std::invalid_argument("invalid map file"); } -- cgit v1.2.3