Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#7050 closed Bugs (fixed)

Invalid memory write bug in lexing_exception

Reported by: g.gupta@… Owned by: Hartmut Kaiser
Milestone: To Be Determined Component: wave
Version: Boost 1.50.0 Severity: Problem
Keywords: Cc: yogen.saini@…

Description

In file boost/wave/cpplexer/cpplexer_exceptions.hpp

lexing_exception(char const *what_, error_code code, int line_,
        int column_, char const *filename_) throw()
    :   cpplexer_exception(line_, column_, filename_),
        level(severity_level(code)), code(code)
    {
        unsigned int off = 0;
        while (off < sizeof(buffer) && *what_)
            buffer[off++] = *what_++;
        buffer[off] = 0;
    }

If value of off is 511, then Invalid memory write will occur at buffer[off] = 0;.
Attached patch is the fix for it.

Attachments (1)

cpplexer_exceptions.hpp_patch (634 bytes ) - added by g.gupta@… 10 years ago.
Patch file for the reported Bug.

Download all attachments as: .zip

Change History (3)

by g.gupta@…, 10 years ago

Patch file for the reported Bug.

comment:1 by Hartmut Kaiser, 10 years ago

Resolution: fixed
Status: newclosed

(In [79174]) Wave: fixed #7050: Invalid memory write bug in lexing_exception

comment:2 by Hartmut Kaiser, 10 years ago

(In [79175]) Wave: fixed #7050: Invalid memory write bug in lexing_exception

Note: See TracTickets for help on using tickets.