proper strings, adapt dt's exported string in the same way.
Old/new files/tools will not work the same way.
That this interface needs to also change was pointed out by jsg
-/* $OpenBSD: dt_dev.c,v 1.20 2022/01/20 07:49:25 visa Exp $ */
+/* $OpenBSD: dt_dev.c,v 1.21 2022/02/22 17:26:04 deraadt Exp $ */
/*
* Copyright (c) 2019 Martin Pieuchot <mpi@openbsd.org>
nanotime(&dtev->dtev_tsp);
if (ISSET(dp->dp_evtflags, DTEVT_EXECNAME))
- memcpy(dtev->dtev_comm, p->p_p->ps_comm, DTMAXCOMLEN - 1);
+ strlcpy(dtev->dtev_comm, p->p_p->ps_comm, sizeof(dtev->dtev_comm));
if (ISSET(dp->dp_evtflags, DTEVT_KSTACK|DTEVT_USTACK)) {
if (profiling)
-/* $OpenBSD: dtvar.h,v 1.11 2022/01/09 05:42:37 jsg Exp $ */
+/* $OpenBSD: dtvar.h,v 1.12 2022/02/22 17:26:04 deraadt Exp $ */
/*
* Copyright (c) 2019 Martin Pieuchot <mpi@openbsd.org>
#include <sys/time.h>
/*
- * Length of provider/probe/function names, including terminating '\0'.
+ * Length of provider/probe/function names, including NUL.
*/
#define DTNAMESIZE 16
/*
- * Length of process name, keep in sync with MAXCOMLEN.
+ * Length of process name, including NUL.
*/
-#define DTMAXCOMLEN 16
+#define DTMAXCOMLEN _MAXCOMLEN
/*
* Maximum number of arguments passed to a function.
* Recorded if the corresponding flag is set.
*/
struct stacktrace dtev_kstack; /* kernel stack frame */
- char dtev_comm[DTMAXCOMLEN+1]; /* current pr. name */
+ char dtev_comm[DTMAXCOMLEN]; /* current pr. name */
union {
register_t E_entry[DTMAXFUNCARGS];
struct {
-/* $OpenBSD: btrace.c,v 1.61 2021/12/07 22:17:03 guenther Exp $ */
+/* $OpenBSD: btrace.c,v 1.62 2022/02/22 17:26:04 deraadt Exp $ */
/*
* Copyright (c) 2019 - 2021 Martin Pieuchot <mpi@openbsd.org>
/* Initialize "fake" event for BEGIN/END */
bt_devt.dtev_pbn = -1;
- memcpy(&bt_devt.dtev_comm, getprogname(), sizeof(bt_devt.dtev_comm));
+ strlcpy(bt_devt.dtev_comm, getprogname(), sizeof(bt_devt.dtev_comm));
bt_devt.dtev_pid = getpid();
bt_devt.dtev_tid = getthrid();
clock_gettime(CLOCK_REALTIME, &bt_devt.dtev_tsp);