summaryrefslogtreecommitdiff
path: root/libpthread/linuxthreads_db/td_ta_new.c
diff options
context:
space:
mode:
Diffstat (limited to 'libpthread/linuxthreads_db/td_ta_new.c')
-rw-r--r--libpthread/linuxthreads_db/td_ta_new.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libpthread/linuxthreads_db/td_ta_new.c b/libpthread/linuxthreads_db/td_ta_new.c
index f19798b71..9bf926719 100644
--- a/libpthread/linuxthreads_db/td_ta_new.c
+++ b/libpthread/linuxthreads_db/td_ta_new.c
@@ -126,6 +126,10 @@ td_ta_new (struct ps_prochandle *ps, td_thragent_t **ta)
{
if (ps_pdread (ps, addr, &(*ta)->sizeof_descr, sizeof (int)) != PS_OK)
goto free_return;
+ /* Don't let bogons in the inferior make us mess ourselves. */
+ if ((*ta)->sizeof_descr > sizeof (struct _pthread_descr_struct))
+ (*ta)->sizeof_descr = sizeof (struct _pthread_descr_struct);
+
}
/* Now add the new agent descriptor to the list. */