Change in ...libosmocore[master]: cbsp: Fix decoding of WRITE-REPLACE payload

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

laforge gerrit-no-reply at lists.osmocom.org
Sun Sep 1 20:33:15 UTC 2019


laforge has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmocore/+/15372


Change subject: cbsp: Fix decoding of WRITE-REPLACE payload
......................................................................

cbsp: Fix decoding of WRITE-REPLACE payload

The user length is the first IE *in* the fixed-length TV, make sure
cbsp_dec_write_repl() respects that.

Change-Id: I864cafac2466a89a4bd9644bc73363fff2babd03
---
M src/gsm/cbsp.c
1 file changed, 2 insertions(+), 2 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/72/15372/1

diff --git a/src/gsm/cbsp.c b/src/gsm/cbsp.c
index 591ff25..ccc2df5 100644
--- a/src/gsm/cbsp.c
+++ b/src/gsm/cbsp.c
@@ -687,8 +687,8 @@
 			}
 			page = talloc_zero(ctx, struct osmo_cbsp_content);
 			OSMO_ASSERT(page);
-			page->user_len = *(ie-1); /* length byte before payload */
-			memcpy(page->data, ie, sizeof(page->data));
+			page->user_len = ie[0]; /* length byte before payload */
+			memcpy(page->data, ie+1, sizeof(page->data));
 			llist_add_tail(&page->list, &out->u.cbs.msg_content);
 		}
 	} else {

-- 
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/15372
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I864cafac2466a89a4bd9644bc73363fff2babd03
Gerrit-Change-Number: 15372
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <laforge at gnumonks.org>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20190901/ff68b69b/attachment.htm>


More information about the gerrit-log mailing list