aboutsummaryrefslogtreecommitdiff
path: root/gdb/dtrace-probe.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/dtrace-probe.c')
-rw-r--r--gdb/dtrace-probe.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/gdb/dtrace-probe.c b/gdb/dtrace-probe.c
index 3f2548d..9816f07 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)