cloudbase / wnbd

Windows Ceph RBD NBD driver
GNU Lesser General Public License v2.1
58 stars 26 forks source link

driver: properly validate the inquiry buffer size #73

Closed petrutlucian94 closed 1 year ago

petrutlucian94 commented 1 year ago

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