Re: [BlueZ PATCH] shared: Fix the incorrect type with bit shift

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Marcel,

On Thu, 2022-02-17 at 10:55 +0100, Marcel Holtmann wrote:
> Hi Tedd,
> 
> > This patch fixes the following runtime error:
> > 
> > $ sudo ./monitor/btmon -w test.btsnoop
> >  Bluetooth monitor ver 5.63
> >  src/shared/btsnoop.c:339:18: runtime error: left shift of 65535 by 16 places cannot be represented in type 'int'
> 
> what compiler version is this? Or what warnings did you enable? Since this is weird, so while yes 0xffff can not be shifted, but we are also not shifting into an uint16_t. The fix is fine, I am just
> curious. There will be other places with the same problem.

I am using gcc 9.3.0 came with Ubuntu 20.04.
This is enabled by the "-fsanitize=undefined" option.

Recent change enabled LSAN, ASAN, and UBSAN by default.


> 
> Regards
> 
> Marcel
> 





[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux