dexter has submitted this change. ( 
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(-)

Approvals:
  lynxis lazus: Looks good to me, approved
  pespin: Looks good to me, approved
  Jenkins Builder: Verified
  fixeria: Looks good to me, but someone else must approve




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: merged
Gerrit-Project: osmo-sgsn
Gerrit-Branch: master
Gerrit-Change-Id: If348e15a98fd6d28a1de08df57983bb710001d73
Gerrit-Change-Number: 43957
Gerrit-PatchSet: 1
Gerrit-Owner: dexter <[email protected]>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: dexter <[email protected]>
Gerrit-Reviewer: fixeria <[email protected]>
Gerrit-Reviewer: lynxis lazus <[email protected]>
Gerrit-Reviewer: pespin <[email protected]>

Reply via email to