Boost logo

Boost-Commit :

From: kbelco_at_[hidden]
Date: 2008-01-02 23:00:58


Author: noel_belcourt
Date: 2008-01-02 23:00:58 EST (Wed, 02 Jan 2008)
New Revision: 42429
URL: http://svn.boost.org/trac/boost/changeset/42429

Log:
Truncate lines in bjam.log to 8k bytes to avoid very deep recursion
in the split function in process_jam_log.cpp. This patch fixes
process_jam_log crashes resulting from 500k byte pgi compiler
messages.

Text files modified:
   trunk/tools/regression/src/process_jam_log.cpp | 3 +++
   1 files changed, 3 insertions(+), 0 deletions(-)

Modified: trunk/tools/regression/src/process_jam_log.cpp
==============================================================================
--- trunk/tools/regression/src/process_jam_log.cpp (original)
+++ trunk/tools/regression/src/process_jam_log.cpp 2008-01-02 23:00:58 EST (Wed, 02 Jan 2008)
@@ -633,9 +633,12 @@
   // * Calls stop_message() to stop capturing lines.
   // * Capture lines if line capture on.
 
+ static const int max_line_length = 8192;
   int line_num = 0;
   while ( std::getline( *input, line ) )
   {
+ if (max_line_length < line.size()) line = line.substr(0, max_line_length);
+
     ++line_num;
     
     std::vector<std::string> const line_parts( split( line ) );


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk