summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorToomas Soome <tsoome@me.com>2020-05-13 14:33:14 +0300
committerToomas Soome <tsoome@me.com>2021-03-01 10:51:39 +0200
commit8ad466288742ffe497149f668ec1c028def2c686 (patch)
tree90b701b6d05f4c25b9fd4c139b7f80c3e8dd19d3
parent718fc4ac1dfcd860e967fb444c831507f97cd300 (diff)
downloadillumos-joyent-8ad466288742ffe497149f668ec1c028def2c686.tar.gz
13585 stmf: array subscript is above array bounds
Reviewed by: C Fraire <cfraire@me.com> Reviewed by: Andy Fiddaman <andy@omniosce.org> Approved by: Dan McDonald <danmcd@joyent.com>
-rw-r--r--usr/src/uts/common/io/comstar/stmf/lun_map.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/usr/src/uts/common/io/comstar/stmf/lun_map.c b/usr/src/uts/common/io/comstar/stmf/lun_map.c
index 41d5f7e9c8..a672534778 100644
--- a/usr/src/uts/common/io/comstar/stmf/lun_map.c
+++ b/usr/src/uts/common/io/comstar/stmf/lun_map.c
@@ -247,6 +247,7 @@ stmf_session_prepare_report_lun_data(stmf_lun_map_t *sm)
stmf_xfer_data_t *xd;
uint16_t nluns, ent;
uint32_t alloc_size, data_size;
+ uchar_t *buf;
int i;
nluns = sm->lm_nluns;
@@ -272,12 +273,13 @@ stmf_session_prepare_report_lun_data(stmf_lun_map_t *sm)
ent = 0;
+ buf = &(xd->buf[0]);
for (i = 0; ((i < sm->lm_nentries) && (ent < nluns)); i++) {
if (sm->lm_plus[i] == NULL)
continue;
/* Fill in the entry */
- xd->buf[8 + (ent << 3) + 1] = (uchar_t)i;
- xd->buf[8 + (ent << 3) + 0] = ((uchar_t)(i >> 8));
+ buf[8 + (ent << 3) + 1] = (uchar_t)i;
+ buf[8 + (ent << 3) + 0] = ((uchar_t)(i >> 8));
ent++;
}