fixeria has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-remsim/+/44183?usp=email ) Change subject: bankd: fix hh_ext pointer arithmetic in worker_transceive_loop() ...................................................................... bankd: fix hh_ext pointer arithmetic in worker_transceive_loop() The pointer to the IPA extension header was calculated as follows: hh_ext = (struct ipaccess_head_ext *) buf + sizeof(*hh); Due to the operator precedence, 'buf' is casted first, so the offset is scaled by sizeof(struct ipaccess_head_ext) rather than being added in bytes. This happens to work only because that struct is 1 byte in size. Point hh_ext to the data following the IPA header instead. No functional change. Change-Id: Ib3675125b4e30cb2d59c799e68167753bef2358c --- M src/bankd/bankd_main.c 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-remsim refs/changes/83/44183/1 diff --git a/src/bankd/bankd_main.c b/src/bankd/bankd_main.c index d04b468..70aa9f9 100644 --- a/src/bankd/bankd_main.c +++ b/src/bankd/bankd_main.c @@ -1028,7 +1028,7 @@ return 0; } - hh_ext = (struct ipaccess_head_ext *) buf + sizeof(*hh); + hh_ext = (struct ipaccess_head_ext *) hh->data; if (data_len < sizeof(*hh_ext)) { LOGW(worker, "Received short message\n"); return -5; -- To view, visit https://gerrit.osmocom.org/c/osmo-remsim/+/44183?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: newchange Gerrit-Project: osmo-remsim Gerrit-Branch: master Gerrit-Change-Id: Ib3675125b4e30cb2d59c799e68167753bef2358c Gerrit-Change-Number: 44183 Gerrit-PatchSet: 1 Gerrit-Owner: fixeria <vyanitskiy@sysmocom.de>