From 0291cf9800d938d417d8df0d1023b51ab52f045b Mon Sep 17 00:00:00 2001 From: mpi Date: Thu, 9 Sep 2021 11:20:40 +0000 Subject: [PATCH] Let ba2str() handle unitialized map just like ba2long() does. --- usr.sbin/btrace/btrace.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/usr.sbin/btrace/btrace.c b/usr.sbin/btrace/btrace.c index a84ab5c40ca..371ddf6b9df 100644 --- a/usr.sbin/btrace/btrace.c +++ b/usr.sbin/btrace/btrace.c @@ -1,4 +1,4 @@ -/* $OpenBSD: btrace.c,v 1.54 2021/09/09 09:53:11 mpi Exp $ */ +/* $OpenBSD: btrace.c,v 1.55 2021/09/09 11:20:40 mpi Exp $ */ /* * Copyright (c) 2019 - 2021 Martin Pieuchot @@ -1388,6 +1388,11 @@ ba2str(struct bt_arg *ba, struct dt_evt *dtev) break; case B_AT_MAP: bv = ba->ba_value; + /* Unitialized map */ + if (bv->bv_value == NULL) { + str = buf; + break; + } str = ba2str(map_get((struct map *)bv->bv_value, ba2str(ba->ba_key, dtev)), dtev); break; -- 2.20.1