diff --git a/lib/scsi-lowlevel.c b/lib/scsi-lowlevel.c index 0aff97a..3a4138c 100644 --- a/lib/scsi-lowlevel.c +++ b/lib/scsi-lowlevel.c @@ -1082,7 +1082,7 @@ scsi_get_task_private_ptr(struct scsi_task *task) struct scsi_data_buffer { struct scsi_data_buffer *next; - int len; + uint32_t len; unsigned char *data; }; @@ -1091,6 +1091,9 @@ scsi_task_add_data_in_buffer(struct scsi_task *task, int len, unsigned char *buf { struct scsi_data_buffer *data_buf; + if (len < 0) { + return -1; + } data_buf = scsi_malloc(task, sizeof(struct scsi_data_buffer)); if (data_buf == NULL) { return -1;