pespin submitted this change.
server: Limit rx buffer size to UINT16_MAX
We can't receive bigger buffers anyway as limited by protocol and msgb
itself, so trim it.
Change-Id: I96bfe1625510cca67f5781e2895caf2a3612ec62
---
M src/osmo_server_core.c
1 file changed, 3 insertions(+), 0 deletions(-)
diff --git a/src/osmo_server_core.c b/src/osmo_server_core.c
index f6c42ce..14a1410 100644
--- a/src/osmo_server_core.c
+++ b/src/osmo_server_core.c
@@ -149,6 +149,9 @@
pcapng_max_len_opt +
sizeof(uint32_t);
data_max_len = OSMO_MAX(data_max_len, pcapng_epb_max_len + server->max_snaplen);
+
+ /* We are limited by (struct osmo_pcap_data)->len and msgb->len being uint16: */
+ data_max_len = OSMO_MIN(data_max_len, UINT16_MAX);
return data_max_len;
}
To view, visit change 39340. To unsubscribe, or for help writing mail filters, visit settings.