This is the mail archive of the
gdb-testers@sourceware.org
mailing list for the GDB project.
[binutils-gdb] gdb: Guard against NULL dereference in dwarf2_init_integer_type
- From: sergiodj+buildbot at sergiodj dot net
- To: gdb-testers at sourceware dot org
- Date: Wed, 07 Nov 2018 10:40:21 -0500
- Subject: [binutils-gdb] gdb: Guard against NULL dereference in dwarf2_init_integer_type
*** TEST RESULTS FOR COMMIT 35ee2dc2e4de8b1ae73f420d5db3375f92300b70 ***
Author: Andrew Burgess <andrew.burgess@embecosm.com>
Branch: master
Commit: 35ee2dc2e4de8b1ae73f420d5db3375f92300b70
gdb: Guard against NULL dereference in dwarf2_init_integer_type
In this commit:
commit eb77c9df9f6d2f7aa644a170280fe31ce080f887
Date: Thu Oct 18 14:04:27 2018 +0100
gdb: Handle ICC's unexpected void return type
A potential dereference of a NULL pointer was introduced if a
DW_TAG_base_type is missing a DW_AT_name attribute.
I have taken this opportunity to fix a slight confusion that existed
in the test also added in the above commit, the test had two C
variables, declared like this:
int var_a = 5;
void *var_ptr = &var_a;
However, the fake DWARF in the test script declared them like this:
void var_a = 5;
void *var_ptr = &var_a;
This wasn't a problem as the test never uses 'var_a' directly, this
only exists so 'var_ptr' can be initialised. However, it seemed worth
fixing.
I've also added a test for a DW_TAG_base_type with a missing
DW_AT_name, as clearly there's not test currently that covers this
(the original patch tested cleanly). I can confirm that the new test
causes GDB to crash before this patch, and passes with this patch.
gdb/ChangeLog:
* dwarf2read.c (dwarf2_init_integer_type): Check for name being
NULL before dereferencing it.
gdb/testsuite/ChangeLog:
* gdb.dwarf2/void-type.exp: Rename types, and make var_a an 'int'.
* gdb.dwarf2/missing-type-name.exp: New file.
- Follow-Ups:
- Failures on Fedora-i686, branch master
- Failures on Fedora-x86_64-cc-with-index, branch master
- Failures on Fedora-x86_64-native-extended-gdbserver-m32, branch master
- Failures on Fedora-x86_64-native-extended-gdbserver-m64, branch master
- Failures on Fedora-s390x-m64, branch master
- Failures on Fedora-x86_64-m64, branch master
- Failures on Fedora-x86_64-native-gdbserver-m64, branch master
- Failures on Fedora-x86_64-m32, branch master
- Failures on Fedora-x86_64-native-gdbserver-m32, branch master
- Failures on RHEL-s390x-m64, branch master
- Failures on Ubuntu-Aarch64-native-extended-gdbserver-m64, branch master
- Failures on Ubuntu-Aarch64-native-gdbserver-m64, branch master
- Failures on Ubuntu-Aarch64-m64, branch master
- Failures on Debian-s390x-native-gdbserver-m64, branch master
- Failures on Debian-s390x-m64, branch master