Boost logo

Boost :

Subject: [boost] Bug in lexertl library (in Spirit)
From: Alejandro Rivero Pérez (alex_at_[hidden])
Date: 2009-08-25 12:25:02

There is a bug in the lexertl library. This library is being used in spirit but being prepared for submission to boost as a separate library.
The file consts.hpp contains the lines:
    const std::size_t num_wchar_ts =
        (boost::integer_traits<wchar_t>::const_max < 0x110000) ?
        boost::integer_traits<wchar_t>::const_max: 0x110000;

Which should be:

    const std::size_t num_wchar_ts =
        (boost::integer_traits<wchar_t>::const_max + 1 < 0x110000) ?
        boost::integer_traits<wchar_t>::const_max + 1: 0x110000;
Currently the lexer will cause a buffer overflow parsing a 0xffff value in a wchar_t buffer (assuming sizeof(wchar_t) is 2).

Best regards, Alex

Boost list run by bdawes at, gregod at, cpdaniel at, john at