summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/monitor.cc5
-rw-r--r--src/proxy.cc2
2 files changed, 6 insertions, 1 deletions
diff --git a/src/monitor.cc b/src/monitor.cc
index cffe3d5..b2157f7 100644
--- a/src/monitor.cc
+++ b/src/monitor.cc
@@ -164,6 +164,11 @@ private:
size_t offset = 0;
while (offset + 5 < package_fill_) {
uint16_t size = read_u16(package_ + offset + 3);
+ if (size == 0) {
+ assert(false);
+ offset += 5;
+ break;
+ }
if (offset + size > package_fill_) break;
size_t o = 5;
if (size >= 3 && memcmp(package_ + offset, "PKG", 3) == 0) {
diff --git a/src/proxy.cc b/src/proxy.cc
index b8df00c..e68645f 100644
--- a/src/proxy.cc
+++ b/src/proxy.cc
@@ -1942,7 +1942,7 @@ void ProxyImpl::send_attached_data(uint32_t id, void const* ptr, size_t size,
if (size == 0) {
assert(last);
assert(ptr == nullptr);
- write_u16(data + 3, 10);
+ write_u16(data + 3, 22);
data[9] = 0;
send_attached(data, 22, nullptr, 0);
} else {