mirror of
https://github.com/SCST-project/scst.git
synced 2026-08-19 05:36:22 +00:00
scst_pres: Avoid reading past the end of a buffer
Detected by smatch. git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7915 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
@@ -762,7 +762,7 @@ static int scst_pr_do_load_device_file(struct scst_device *dev,
|
||||
}
|
||||
pos += sizeof(version);
|
||||
|
||||
while (data_size < file_size) {
|
||||
while (data_size + 1 < file_size) {
|
||||
uint8_t *tid;
|
||||
|
||||
data_size++;
|
||||
@@ -794,7 +794,7 @@ static int scst_pr_do_load_device_file(struct scst_device *dev,
|
||||
dev->pr_scope = buf[pos];
|
||||
pos += sizeof(dev->pr_scope);
|
||||
|
||||
while (pos < file_size) {
|
||||
while (pos + 1 < file_size) {
|
||||
uint8_t is_holder;
|
||||
uint8_t *tid;
|
||||
struct scst_dev_registrant *reg = NULL;
|
||||
|
||||
Reference in New Issue
Block a user