From 569517b808735f514f6d2e9fadb7922af4610960 Mon Sep 17 00:00:00 2001 From: Wei Chen Date: Fri, 1 Nov 2019 11:31:41 -0700 Subject: [PATCH] GPS HW module: fix << overflow issue Fix shift overflow when the number of bits shifted can exceed 31 bits Change-Id: Ib4334fd9b3bf574b8d8143a5f706ca9e963a6053 CRs-fixed: 2557855 --- gnss/GnssAdapter.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gnss/GnssAdapter.cpp b/gnss/GnssAdapter.cpp index dee969ab..f7e1c0d2 100644 --- a/gnss/GnssAdapter.cpp +++ b/gnss/GnssAdapter.cpp @@ -1518,7 +1518,7 @@ GnssAdapter::convertToGnssSvIdConfig( LOC_LOGe("Invalid sv id %d for sv type %d", source.svId, source.constellation); } else { - *svMaskPtr |= (1 << (source.svId - initialSvId)); + *svMaskPtr |= (1ULL << (source.svId - initialSvId)); } } }