diff --git a/gdb/ChangeLog b/gdb/ChangeLog index ce42136baf..67a61d8ca1 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,9 @@ +2015-08-07 Joel Brobecker + + * dtrace-probe.c (dtrace_process_dof): Ignore the objfile's DOF + data if a DTRACE_DOF_SECT_TYPE_PROVIDER section is found to be + smaller than expected. + 2015-08-07 Andrew Burgess * stack.c (get_frame_language): Moved ... diff --git a/gdb/dtrace-probe.c b/gdb/dtrace-probe.c index 3f2548ddc4..9816f0792a 100644 --- a/gdb/dtrace-probe.c +++ b/gdb/dtrace-probe.c @@ -519,6 +519,14 @@ dtrace_process_dof (asection *sect, struct objfile *objfile, unsigned int entsize = DOF_UINT (dof, probes_s->dofs_entsize); int num_probes; + if (DOF_UINT (dof, section->dofs_size) + < sizeof (struct dtrace_dof_provider)) + { + /* The section is smaller than expected, so do not use it. + This has been observed on x86-solaris 10. */ + goto invalid_dof_data; + } + /* Very, unlikely, but could crash gdb if not handled properly. */ if (entsize == 0)