From 9cf6efbe4e96ae689d160622d7c3360b2f259611 Mon Sep 17 00:00:00 2001 From: mpi Date: Tue, 23 Jan 2024 22:04:15 +0000 Subject: [PATCH] Consider the whole tuple when reading a map entry whose key is that tuple. Previously only the first element of the tuple was considered. This led to the introduction of new map entries. Reported by Christian Ludwig. --- usr.sbin/btrace/btrace.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/usr.sbin/btrace/btrace.c b/usr.sbin/btrace/btrace.c index 3096a534f43..ac8b5d97d99 100644 --- a/usr.sbin/btrace/btrace.c +++ b/usr.sbin/btrace/btrace.c @@ -1,4 +1,4 @@ -/* $OpenBSD: btrace.c,v 1.81 2023/11/10 18:56:21 jasper Exp $ */ +/* $OpenBSD: btrace.c,v 1.82 2024/01/23 22:04:15 mpi Exp $ */ /* * Copyright (c) 2019 - 2023 Martin Pieuchot @@ -1631,7 +1631,7 @@ ba2long(struct bt_arg *ba, struct dt_evt *dtev) if (bv->bv_value == NULL) return 0; val = ba2long(map_get((struct map *)bv->bv_value, - ba2str(ba->ba_key, dtev)), dtev); + ba2hash(ba->ba_key, dtev)), dtev); break; case B_AT_NIL: val = 0L; @@ -1767,7 +1767,7 @@ ba2str(struct bt_arg *ba, struct dt_evt *dtev) break; } str = ba2str(map_get((struct map *)bv->bv_value, - ba2str(ba->ba_key, dtev)), dtev); + ba2hash(ba->ba_key, dtev)), dtev); break; case B_AT_VAR: str = ba2str(ba_read(ba), dtev); -- 2.20.1