[MERGED] libosmocore[master]: gprs_cipher_core: Use typecase to avoid sanitizer error

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

Harald Welte gerrit-no-reply at lists.osmocom.org
Fri Jan 6 10:03:31 UTC 2017


Harald Welte has submitted this change and it was merged.

Change subject: gprs_cipher_core: Use typecase to avoid sanitizer error
......................................................................


gprs_cipher_core: Use typecase to avoid sanitizer error

This resolves
gprs_cipher_core.c:118:37: runtime error: left shift of 1 by 31 places cannot be represented in type 'int'

Change-Id: Ib1866595030ad9d11c886621ce69632462befa3a
---
M src/gsm/gprs_cipher_core.c
1 file changed, 1 insertion(+), 1 deletion(-)

Approvals:
  Max: Looks good to me, but someone else must approve
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/src/gsm/gprs_cipher_core.c b/src/gsm/gprs_cipher_core.c
index 8f020b3..da6e0a8 100644
--- a/src/gsm/gprs_cipher_core.c
+++ b/src/gsm/gprs_cipher_core.c
@@ -115,7 +115,7 @@
 /* GSM TS 04.64 / Section A.2.1 : Generation of 'input' */
 uint32_t gprs_cipher_gen_input_ui(uint32_t iov_ui, uint8_t sapi, uint32_t lfn, uint32_t oc)
 {
-	uint32_t sx = ((1<<27) * sapi) + (1<<31);
+	uint32_t sx = ((1<<27) * sapi) + ((uint32_t ) 1<<31);
 
 	return (iov_ui ^ sx) + lfn + oc;
 }

-- 
To view, visit https://gerrit.osmocom.org/1530
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ib1866595030ad9d11c886621ce69632462befa3a
Gerrit-PatchSet: 2
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Owner: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Max <msuraev at sysmocom.de>



More information about the gerrit-log mailing list