Linux DTrace development list
 help / color / mirror / Atom feed
* [PATCH 2/2] consume: avoid a bad prid causing a core dump
@ 2025-03-21 14:43 Kris Van Hees
  2025-03-21 15:06 ` [DTrace-devel] " Nick Alcock
  0 siblings, 1 reply; 2+ messages in thread
From: Kris Van Hees @ 2025-03-21 14:43 UTC (permalink / raw)
  To: dtrace-devel, dtrace

We were not guarding against prid being DTACE_IDNONE (0), which would
cause a core dump if it was encountered in a trace record.

Signed-off-by: Kris Van Hees <kris.van.hees@oracle.com>
---
 libdtrace/dt_consume.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libdtrace/dt_consume.c b/libdtrace/dt_consume.c
index 58a2ead9..ed52b88b 100644
--- a/libdtrace/dt_consume.c
+++ b/libdtrace/dt_consume.c
@@ -2191,7 +2191,7 @@ dt_consume_one_probe(dtrace_hdl_t *dtp, FILE *fp, char *data, uint32_t size,
 	pdat->dtpda_stid = stid;
 	pdat->dtpda_data = data;
 
-	if (prid >= dtp->dt_probe_id)
+	if (prid >= dtp->dt_probe_id || prid == DTRACE_IDNONE)
 		return dt_set_errno(dtp, EDT_BADID);
 	pdat->dtpda_pdesc = (dtrace_probedesc_t *)dtp->dt_probes[prid]->desc;
 	if (dt_stid_lookup(dtp, stid, &pdat->dtpda_ddesc) != 0)
-- 
2.45.2


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-03-21 15:06 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-21 14:43 [PATCH 2/2] consume: avoid a bad prid causing a core dump Kris Van Hees
2025-03-21 15:06 ` [DTrace-devel] " Nick Alcock

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox