Change in osmocom-bb[master]: mobile/gsm48_rr.h: mark gsm48_rr_hdr struct as packed

Vadim Yanitskiy gerrit-no-reply at lists.osmocom.org
Thu May 2 22:58:03 UTC 2019


Vadim Yanitskiy has uploaded this change for review. ( https://gerrit.osmocom.org/13856


Change subject: mobile/gsm48_rr.h: mark gsm48_rr_hdr struct as packed
......................................................................

mobile/gsm48_rr.h: mark gsm48_rr_hdr struct as packed

In both gsm48_mm.c and gsm48_rr.c we put / push 'gsm48_rr_hdr'
structure into the message buffers, so then it's retrieved by
the message receivers. The AddressSanitizer complains about
unaligned pointer access and potentially unexpected behaviour.

Change-Id: I8aa2c0074b405afd0e76044ef076b6819fe1083b
---
M src/host/layer23/include/osmocom/bb/mobile/gsm48_rr.h
1 file changed, 1 insertion(+), 1 deletion(-)



  git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/56/13856/1

diff --git a/src/host/layer23/include/osmocom/bb/mobile/gsm48_rr.h b/src/host/layer23/include/osmocom/bb/mobile/gsm48_rr.h
index 6235bfd..6996ff3 100644
--- a/src/host/layer23/include/osmocom/bb/mobile/gsm48_rr.h
+++ b/src/host/layer23/include/osmocom/bb/mobile/gsm48_rr.h
@@ -61,7 +61,7 @@
 	uint32_t		msg_type; /* RR-* primitive */
 	uint8_t			sapi;
 	uint8_t			cause;
-};
+} __attribute__((packed));
 
 /* GSM 04.07 9.1.1 */
 #define GSM48_RR_ST_IDLE		0

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

Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I8aa2c0074b405afd0e76044ef076b6819fe1083b
Gerrit-Change-Number: 13856
Gerrit-PatchSet: 1
Gerrit-Owner: Vadim Yanitskiy <axilirator at gmail.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20190502/8c5aabe1/attachment.html>


More information about the gerrit-log mailing list