Introduce the ibmultipath/unaligned.h header file
authorBart Van Assche <bart.vanassche@wdc.com>
Wed, 7 Mar 2018 23:15:49 +0000 (00:15 +0100)
committerChristophe Varoqui <christophe.varoqui@opensvc.com>
Sat, 10 Mar 2018 07:23:03 +0000 (08:23 +0100)
commite9af3d7ff312976f8a07d402c456ebb8edbcd9f4
tree283cdec3ba1432c1814e6b4df2ce92b5215f752d
parent1f401b69e478b35d4b54b1980be67943c6d61d9f
Introduce the ibmultipath/unaligned.h header file

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@wdc.com>
Signed-off-by: Martin Wilck <mwilck@suse.com>
libmpathpersist/mpath_pr_ioctl.c
libmultipath/checkers/hp_sw.c
libmultipath/discovery.c
libmultipath/prioritizers/alua_rtpg.c
libmultipath/prioritizers/alua_spc3.h
libmultipath/prioritizers/ontap.c
libmultipath/unaligned.h [new file with mode: 0644]