libiberty: demangler crash with missing :? or fold expression component.
authorMark Wielaard <mark@klomp.org>
Tue, 15 Nov 2016 19:31:59 +0000 (19:31 +0000)
committerMark Wielaard <mark@klomp.org>
Fri, 18 Nov 2016 10:06:18 +0000 (11:06 +0100)
commitddc5804ebd4b2be29ad4e3e259f5c6e907f34f26
tree9c865971acdc8f9f31dcab1d34e4e88c98569507
parent1706852c3c6c1d39f949c933d37647d02509b9cb
libiberty: demangler crash with missing :? or fold expression component.

When constructing an :? or fold expression that requires a third
expression only the first and second were explicitly checked to
not be NULL. Since the third expression is also required in these
constructs it needs to be explicitly checked and rejected when missing.
Otherwise the demangler will crash once it tries to d_print the
NULL component. Added two examples to demangle-expected of strings
that would crash before this fix.

Found by American Fuzzy Lop (afl) fuzzer.
libiberty/ChangeLog
libiberty/cp-demangle.c
libiberty/testsuite/demangle-expected
This page took 0.024263 seconds and 4 git commands to generate.