dexter has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-sgsn/+/43957?usp=email )


Change subject: gprs_sndcp_xid: use reasonable static buffer size
......................................................................

gprs_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.

Related: OS#7095
Change-Id: If348e15a98fd6d28a1de08df57983bb710001d73
---
M src/sgsn/gprs_sndcp_xid.c
1 file changed, 1 insertion(+), 1 deletion(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/57/43957/1

diff --git a/src/sgsn/gprs_sndcp_xid.c b/src/sgsn/gprs_sndcp_xid.c
index 0b981b5..834d98a 100644
--- a/src/sgsn/gprs_sndcp_xid.c
+++ b/src/sgsn/gprs_sndcp_xid.c
@@ -566,7 +566,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);

--
To view, visit https://gerrit.osmocom.org/c/osmo-sgsn/+/43957?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings?usp=email

Gerrit-MessageType: newchange
Gerrit-Project: osmo-sgsn
Gerrit-Branch: master
Gerrit-Change-Id: If348e15a98fd6d28a1de08df57983bb710001d73
Gerrit-Change-Number: 43957
Gerrit-PatchSet: 1
Gerrit-Owner: dexter <[email protected]>

Reply via email to