Re: [PATCH][next] seg6: fix unintentional integer overflow on left shift

2020-12-07 Thread Colin Ian King
On 07/12/2020 19:59, Andrea Mayer wrote: > On Mon, 7 Dec 2020 14:45:03 + > Colin King wrote: > >> From: Colin Ian King >> >> Shifting the integer value 1 is evaluated using 32-bit arithmetic >> and then used in an expression that expects a unsigned long value >> leads to a potential integer

Re: [PATCH][next] seg6: fix unintentional integer overflow on left shift

2020-12-07 Thread Andrea Mayer
On Mon, 7 Dec 2020 14:45:03 + Colin King wrote: > From: Colin Ian King > > Shifting the integer value 1 is evaluated using 32-bit arithmetic > and then used in an expression that expects a unsigned long value > leads to a potential integer overflow. Fix this by using the BIT > macro to per

[PATCH][next] seg6: fix unintentional integer overflow on left shift

2020-12-07 Thread Colin King
From: Colin Ian King Shifting the integer value 1 is evaluated using 32-bit arithmetic and then used in an expression that expects a unsigned long value leads to a potential integer overflow. Fix this by using the BIT macro to perform the shift to avoid the overflow. Addresses-Coverity: ("Uninit