Solve security (denial of service) issue in the WML preprocessor (bug #19233)

This commit is contained in:
Ignacio R. Morelle 2012-01-06 19:12:42 +00:00
parent 6e1542cb94
commit 471620c5ea
2 changed files with 6 additions and 0 deletions

View file

@ -17,6 +17,8 @@ Version 1.9.13+svn:
BLIT image mod (bug #19208)
* New key [object]delayed_variable_substitution=yes|no (default no)
as a workaround for bug #18893 (fixes bug #19225)
* Made empty {} preprocessor directives be handled more gracefully
(bug #19233)
* Miscellaneous and bug fixes:
* Fixed bug #19032: Poison and level up AI defense placement calculation
* Fixed bug #19245: wesnoth(6) man page doesn't describe the --campaign*

View file

@ -991,6 +991,10 @@ bool preprocessor_data::get_chunk()
// strings_.pop_back();
//}
if(strings_.size() <= static_cast<size_t>(token.stack_pos)) {
target_.error("No macro or file substitution target specified", linenum_);
}
std::string symbol = strings_[token.stack_pos];
std::string::size_type pos;
while ((pos = symbol.find('\376')) != std::string::npos) {