]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
PR symtab/17890
authorDoug Evans <dje@google.com>
Thu, 29 Jan 2015 18:31:21 +0000 (10:31 -0800)
committerDoug Evans <dje@google.com>
Thu, 29 Jan 2015 18:31:21 +0000 (10:31 -0800)
gdb/ChangeLog:

PR symtab/17890
* dwarf2read.c (dwarf_decode_line_header): Punt if version > 4.

gdb/ChangeLog
gdb/dwarf2read.c

index 98ec3b767d1d8d93bf7ef98770aa4ab82869869b..330bffedba99bf16297824db574ef37c4c7c73d0 100644 (file)
@@ -1,3 +1,8 @@
+2015-01-29  Doug Evans  <dje@google.com>
+
+       PR symtab/17890
+       * dwarf2read.c (dwarf_decode_line_header): Punt if version > 4.
+
 2015-01-26  Wei-cheng Wang  <cole945@gmail.com>
 
        Backport from mainline:
index f1f24c69dffacb16f181aafdd836ef0888446311..89119b3ae19fa217b1c9b2eaf093d16a957e7df5 100644 (file)
@@ -17117,6 +17117,8 @@ get_debug_line_section (struct dwarf2_cu *cu)
 /* Read the statement program header starting at OFFSET in
    .debug_line, or .debug_line.dwo.  Return a pointer
    to a struct line_header, allocated using xmalloc.
+   Returns NULL if there is a problem reading the header, e.g., if it
+   has a version we don't understand.
 
    NOTE: the strings in the include directory and file name tables of
    the returned object point into the dwarf line section buffer,
@@ -17181,6 +17183,14 @@ dwarf_decode_line_header (unsigned int offset, struct dwarf2_cu *cu)
   lh->statement_program_end = line_ptr + lh->total_length;
   lh->version = read_2_bytes (abfd, line_ptr);
   line_ptr += 2;
+  if (lh->version > 4)
+    {
+      /* This is a version we don't understand.  The format could have
+        changed in ways we don't handle properly so just punt.  */
+      complaint (&symfile_complaints,
+                _("unsupported version in .debug_line section"));
+      return NULL;
+    }
   lh->header_length = read_offset_1 (abfd, line_ptr, offset_size);
   line_ptr += offset_size;
   lh->minimum_instruction_length = read_1_byte (abfd, line_ptr);