When retrieving the serial number using SCSI inquiry, we're checking the buffer size against a hard-coded value instead of the actual serial size, which can lead to overflows.
This commit addresses the issue, properly checking the buffer size.
While at it, we're disabling bitfield type warnings. storport.h does the same and we'd like to easily reuse storport types. Other compilers such as gcc, mingw and clang are able to handle this.
driver: properly validate the inquiry buffer size
When retrieving the serial number using SCSI inquiry, we're checking the buffer size against a hard-coded value instead of the actual serial size, which can lead to overflows.
This commit addresses the issue, properly checking the buffer size.
While at it, we're disabling bitfield type warnings.
storport.h
does the same and we'd like to easily reuse storport types. Other compilers such as gcc, mingw and clang are able to handle this.Signed-off-by: Lucian Petrut lpetrut@cloudbasesolutions.com