mail[Wesnoth-commits] r36709 - /branches/1.6/src/server/simple_wml.cpp


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

Header


Content

Posted by soliton . de on July 09, 2009 - 03:51:
Author: soliton
Date: Thu Jul  9 03:51:01 2009
New Revision: 36709

URL: http://svn.gna.org/viewcvs/wesnoth?rev=36709&view=rev
Log:
added an assert to make sure we're not allocating crazy amounts of memory

Modified:
    branches/1.6/src/server/simple_wml.cpp

Modified: branches/1.6/src/server/simple_wml.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/branches/1.6/src/server/simple_wml.cpp?rev=36709&r1=36708&r2=36709&view=diff
==============================================================================
--- branches/1.6/src/server/simple_wml.cpp (original)
+++ branches/1.6/src/server/simple_wml.cpp Thu Jul  9 03:51:01 2009
@@ -62,6 +62,7 @@
 
        std::vector<char> buf(in.size()*2 + 80);
        const size_t len = filter.read(&buf[0], buf.size()).gcount();
+       assert(len < 128*1024*1024);
        if((!filter.eof() && !filter.good()) || len == 
static_cast<size_t>(buf.size())) {
                throw error("failed to compress");
        }




Related Messages


Powered by MHonArc, Updated Thu Jul 09 04:00:18 2009