mail[Wesnoth-commits] r52518 - in /trunk: changelog src/serialization/preprocessor.cpp


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by shadowm2006 on January 06, 2012 - 20:12:
Author: shadowmaster
Date: Fri Jan  6 20:12:42 2012
New Revision: 52518

URL: http://svn.gna.org/viewcvs/wesnoth?rev=52518&view=rev
Log:
Solve security (denial of service) issue in the WML preprocessor (bug #19233)

Modified:
    trunk/changelog
    trunk/src/serialization/preprocessor.cpp

Modified: trunk/changelog
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/changelog?rev=52518&r1=52517&r2=52518&view=diff
==============================================================================
--- trunk/changelog (original)
+++ trunk/changelog Fri Jan  6 20:12:42 2012
@@ -17,6 +17,8 @@
      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*

Modified: trunk/src/serialization/preprocessor.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/serialization/preprocessor.cpp?rev=52518&r1=52517&r2=52518&view=diff
==============================================================================
--- trunk/src/serialization/preprocessor.cpp (original)
+++ trunk/src/serialization/preprocessor.cpp Fri Jan  6 20:12:42 2012
@@ -990,6 +990,10 @@
                        //      }
                        //      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;




Related Messages


Powered by MHonArc, Updated Fri Jan 06 20:40:09 2012