]> asedeno.scripts.mit.edu Git - linux.git/commit
block: sed-opal: Fix a couple off by one bugs
authorDan Carpenter <dan.carpenter@oracle.com>
Wed, 20 Jun 2018 10:41:51 +0000 (13:41 +0300)
committerJens Axboe <axboe@kernel.dk>
Wed, 20 Jun 2018 18:04:06 +0000 (12:04 -0600)
commitce042c183bcb94eb2919e8036473a1fc203420f9
treecc88e5d4ee53d4aee85e5607b1e98a9dae5de2cf
parenta1e79188628580465ac6d7a93a313336ee3364f1
block: sed-opal: Fix a couple off by one bugs

resp->num is the number of tokens in resp->tok[].  It gets set in
response_parse().  So if n == resp->num then we're reading beyond the
end of the data.

Fixes: 455a7b238cd6 ("block: Add Sed-opal library")
Reviewed-by: Scott Bauer <scott.bauer@intel.com>
Tested-by: Scott Bauer <scott.bauer@intel.com>
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/sed-opal.c