[pph] Buffer overrun in preprocessor symbol replay

Lawrence Crowl crowl@google.com
Thu Mar 10 02:06:00 GMT 2011


In my last PPH change, I eliminated the redundancy in the preprocessor
identifier lookaside table by removing the name of the identifier from
the head of the macro value.  This later led to a buffer overrun in
libcpp/symtab.c cpp_lt_replay.  The buffer was allocated based on the
value string size, which is was no longer large enough to hold the
definition string.

Split cpp_idents_used::max_length and cpp_lookaside::max_length into
max_ident_len and max_value_len.  In cpp_lt_replay, allocate the
buffer based on the sum of max_ident_len and max_value_len.

-- 
Lawrence Crowl
-------------- next part --------------
A non-text attachment was scrubbed...
Name: src.change
Type: application/octet-stream
Size: 1002 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20110310/6c2b1ac1/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: src.patch
Type: text/x-patch
Size: 9783 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20110310/6c2b1ac1/attachment.bin>


More information about the Gcc-patches mailing list