mirror of
https://gitlab.freedesktop.org/libfprint/libfprint.git
synced 2025-11-15 07:38:12 +00:00
goodixmoc: Fix potential invalid shift on integer type
../libfprint/drivers/goodixmoc/goodix_proto.c:111:26: runtime error: left shift of 1 by 31 places cannot be represented in type 'int'
#0 0x7f6776799c2e in reflect ../libfprint/drivers/goodixmoc/goodix_proto.c:111
#1 0x7f677679a0f3 in crc32_final ../libfprint/drivers/goodixmoc/goodix_proto.c:147
#2 0x7f677679a3ee in gx_proto_crc32_calc ../libfprint/drivers/goodixmoc/goodix_proto.c:164
#3 0x7f677679d7aa in gx_proto_init_sensor_config ../libfprint/drivers/goodixmoc/goodix_proto.c:464
#4 0x7f6776797b40 in gx_fp_init ../libfprint/drivers/goodixmoc/goodix.c:1415
#5 0x7f67766cc56e in fp_device_open ../libfprint/fp-device.c:866
#6 0x7f67766d2fd4 in fp_device_open_sync ../libfprint/fp-device.c:1872
This commit is contained in:
committed by
Marco Trevisan
parent
7b2895271d
commit
c1dcaa805d
@@ -107,7 +107,7 @@ reflect (uint32_t data, uint8_t n_bits)
|
||||
* If the LSB bit is set, set the reflection of it.
|
||||
*/
|
||||
if (data & 0x01)
|
||||
reflection |= (1 << ((n_bits - 1) - bit));
|
||||
reflection |= (1LU << ((n_bits - 1) - bit));
|
||||
|
||||
data = (data >> 1);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user