On Thu, 2018-03-01 at 11:29 -0800, Bart Van Assche wrote: > This patch avoids that Coverity reports the following for the code > in libmultipath/prioritizers/alua_rtpg.c: > > CID 173256: Integer handling issues (SIGN_EXTENSION) > Suspicious implicit sign extension: "buf[0]" with type "unsigned > char" (8 bits, unsigned) is promoted in "((buf[0] << 24) | (buf[1] << > 16) | (buf[2] << 8) | buf[3]) + 4" to type "int" (32 bits, signed), > then sign-extended to type "unsigned long" (64 bits, unsigned). If > "((buf[0] << 24) | (buf[1] << 16) | (buf[2] << 8) | buf[3]) + 4" is > greater than 0x7FFFFFFF, the upper bits of the result will all be 1. > > Signed-off-by: Bart Van Assche <bart.vanassche@xxxxxxx> Reviewed-by: Martin Wilck <mwilck@xxxxxxxx> -- Dr. Martin Wilck <mwilck@xxxxxxxx>, Tel. +49 (0)911 74053 2107 SUSE Linux GmbH, GF: Felix Imendörffer, Jane Smithard, Graham Norton HRB 21284 (AG Nürnberg) -- dm-devel mailing list dm-devel@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/dm-devel