This is the mail archive of the
gdb-prs@sourceware.org
mailing list for the GDB project.
[Bug gdb/14181] New: Potential division by 0 indwarf_decode_lines_1()
- From: "ingolf.steinbach at googlemail dot com"<sourceware-bugzilla at sourceware dot org>
- To: gdb-prs at sourceware dot org
- Date: Wed, 30 May 2012 07:40:05 +0000
- Subject: [Bug gdb/14181] New: Potential division by 0 indwarf_decode_lines_1()
- Auto-submitted: auto-generated
http://sourceware.org/bugzilla/show_bug.cgi?id=14181
Bug #: 14181
Summary: Potential division by 0 in dwarf_decode_lines_1()
Product: gdb
Version: 7.4
Status: NEW
Severity: normal
Priority: P2
Component: gdb
AssignedTo: unassigned@sourceware.org
ReportedBy: ingolf.steinbach@googlemail.com
Classification: Unclassified
Host: i686-pc-linux-gnu
Target: sparc-rtems4.8
The function dwarf_decode_lines_1() (gdb/dwarf2read.c) misses some sanity
checks and divides by 0 when there are errors in the ELF file which is selected
for debugging.
In 4.7.1, dwarf_decode_lines_1 contains the following code:
if (op_code >= lh->opcode_base)
{
/* Special operand. */
adj_opcode = op_code - lh->opcode_base;
address += (((op_index + (adj_opcode / lh->line_range))
/ lh->maximum_ops_per_instruction)
* lh->minimum_instruction_length);
There is no safeguard against division by 0 when (for whatever reason)
line_range and/or minimum_instruction_length is 0. As a result, gdb hangs
indefinitely when reading the ELF file.
--
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.