|
From: Lasse Kärkkäi. <tr...@us...> - 2009-12-13 13:18:10
|
Module: performous
Branch: master
Commit: da7b10629e29051a00a0320a0b51eef9f9893a61
Author: Lasse Karkkainen <tro...@tr...>
Date: Sun Dec 13 15:16:50 2009 +0200
Fix infinite loop on sm parser (not tested)
---
game/songparser-sm.cc | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/game/songparser-sm.cc b/game/songparser-sm.cc
index abbf33e..0d20e1c 100644
--- a/game/songparser-sm.cc
+++ b/game/songparser-sm.cc
@@ -120,7 +120,7 @@ bool SongParser::smParseField(std::string line) {
//In case the value continues to several lines, all text before the ending character ';' is read to single line.
while (value[value.size() -1] != ';') {
std::string str;
- getline (str);
+ if (!getline (str)) throw std::runtime_error("Invalid format, semicolon missing after value of " + key);
value += boost::trim_copy(str);
}
value = value.substr(0, value.size() - 1); //Here the end character(';') is eliminated
|