aboutsummaryrefslogtreecommitdiff
path: root/libiberty/testsuite/demangle-expected
diff options
context:
space:
mode:
authorMark Wielaard <mark@klomp.org>2016-11-15 19:31:59 +0000
committerMark Wielaard <mark@gcc.gnu.org>2016-11-15 19:31:59 +0000
commit168126e59828b8d2cc8cbb7e03fbe8341177f58f (patch)
tree8f5009b475fabf82e2a02e550cfd3e7eac405f5d /libiberty/testsuite/demangle-expected
parent0d0bfbf47c67397b8380d5cd47aec8429888b196 (diff)
downloadgcc-168126e59828b8d2cc8cbb7e03fbe8341177f58f.zip
gcc-168126e59828b8d2cc8cbb7e03fbe8341177f58f.tar.gz
gcc-168126e59828b8d2cc8cbb7e03fbe8341177f58f.tar.bz2
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. From-SVN: r242451
Diffstat (limited to 'libiberty/testsuite/demangle-expected')
-rw-r--r--libiberty/testsuite/demangle-expected8
1 files changed, 8 insertions, 0 deletions
diff --git a/libiberty/testsuite/demangle-expected b/libiberty/testsuite/demangle-expected
index 236161c..af491d8 100644
--- a/libiberty/testsuite/demangle-expected
+++ b/libiberty/testsuite/demangle-expected
@@ -4626,3 +4626,11 @@ _$_H1R
# Could crash
_Q8ccQ4M2e.
_Q8ccQ4M2e.
+
+# fold-expression with missing third component could crash.
+_Z12binary_rightIJLi1ELi2ELi3EEEv1AIXfRplT_LiEEE
+_Z12binary_rightIJLi1ELi2ELi3EEEv1AIXfRplT_LiEEE
+
+# ?: expression with missing third component could crash.
+AquT_quT_4mxautouT_4mxxx
+AquT_quT_4mxautouT_4mxxx