Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F102667070
D46194.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
946 B
Referenced Files
None
Subscribers
None
D46194.diff
View Options
diff --git a/usr.sbin/bhyve/gdb.c b/usr.sbin/bhyve/gdb.c
--- a/usr.sbin/bhyve/gdb.c
+++ b/usr.sbin/bhyve/gdb.c
@@ -651,6 +651,28 @@
}
}
+static void
+append_binary_data(const uint8_t *data, size_t len)
+{
+ uint8_t buf[2];
+
+ for (; len > 0; data++, len--) {
+ switch (*data) {
+ case '}':
+ case '#':
+ case '$':
+ case '*':
+ buf[0] = 0x7d;
+ buf[1] = *data ^ 0x20;
+ append_packet_data(buf, 2);
+ break;
+ default:
+ append_packet_data(data, 1);
+ break;
+ }
+ }
+}
+
static void
append_string(const char *str)
{
@@ -1801,10 +1823,10 @@
append_char('l');
} else if (doff + dlen >= xmllen) {
append_char('l');
- append_packet_data(xml + doff, xmllen - doff);
+ append_binary_data(xml + doff, xmllen - doff);
} else {
append_char('m');
- append_packet_data(xml + doff, dlen);
+ append_binary_data(xml + doff, dlen);
}
finish_packet();
(void)munmap(__DECONST(void *, xml), xmllen);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Nov 16, 2:24 PM (21 h, 34 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
14660010
Default Alt Text
D46194.diff (946 B)
Attached To
Mode
D46194: bhyve: Escape binary data sent in reply packets
Attached
Detach File
Event Timeline
Log In to Comment