From 7320a86168d60a6ef5eba3af1bfabdc9230043b4 Mon Sep 17 00:00:00 2001 From: Mark Johnston Date: Wed, 31 Jul 2024 15:22:06 +0000 Subject: [PATCH] bhyve: Escape bytes returned by capability read responses --- usr.sbin/bhyve/gdb.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/usr.sbin/bhyve/gdb.c b/usr.sbin/bhyve/gdb.c index 47c54f8905ee..18cd17624924 100644 --- a/usr.sbin/bhyve/gdb.c +++ b/usr.sbin/bhyve/gdb.c @@ -1976,11 +1976,11 @@ gdb_query(const uint8_t *data, size_t len) append_char('l'); } else if (doff + dlen >= sizeof(capbuf)) { append_char('l'); - append_packet_data(capbuf + doff, + append_binary_data(capbuf + doff, sizeof(capbuf) - doff); } else { append_char('m'); - append_packet_data(capbuf + doff, dlen); + append_binary_data(capbuf + doff, dlen); } finish_packet(); #else