dexter has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmo-gprs/+/43963?usp=email )
Change subject: sndcp_xid: use reasonable static buffer size ......................................................................
sndcp_xid: use reasonable static buffer size
the output of gprs_sndcp_compile_xid is a buffer with TLV objects. Each TLV object is generated into an internal buffer (comp_bytes) before it is added to the output buffer using tlv_put. Since we are using a TLV structure here, the fields cannot exceed a length of 255. Using a buffer size of 512 is misleading.
This patch has been ported from: osmo-sgsn.git If348e15a98fd6d28a1de08df57983bb710001d73
Related: OS#7095 Change-Id: Ic8e7719063d87e5328ebf503e9a43325bb07acf8 --- M src/sndcp/sndcp_xid.c 1 file changed, 1 insertion(+), 1 deletion(-)
git pull ssh://gerrit.osmocom.org:29418/libosmo-gprs refs/changes/63/43963/1
diff --git a/src/sndcp/sndcp_xid.c b/src/sndcp/sndcp_xid.c index 28e8928..a380206 100644 --- a/src/sndcp/sndcp_xid.c +++ b/src/sndcp/sndcp_xid.c @@ -560,7 +560,7 @@ { int rc; int byte_counter = 0; - uint8_t comp_bytes[512]; + uint8_t comp_bytes[256]; uint8_t xid_version_number[1];
OSMO_ASSERT(comp_fields);