From: mpi Date: Thu, 9 Sep 2021 11:20:40 +0000 (+0000) Subject: Let ba2str() handle unitialized map just like ba2long() does. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=0291cf9800d938d417d8df0d1023b51ab52f045b;p=openbsd Let ba2str() handle unitialized map just like ba2long() does. --- 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;