summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorToomas Soome <tsoome@me.com>2020-05-13 14:42:54 +0300
committerToomas Soome <tsoome@me.com>2021-03-10 10:16:02 +0200
commitd464f34577edaa31dd6978ec04d66a57529dd2c8 (patch)
treebc76844994c5f0e4def2d3a2a9aaadf68dce5330
parente3b270024f3e952233b61d3dcb4129ba75bf2720 (diff)
downloadillumos-joyent-d464f34577edaa31dd6978ec04d66a57529dd2c8.tar.gz
13587 stmf_sbd: array subscript 8 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/lu/stmf_sbd/sbd.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/usr/src/uts/common/io/comstar/lu/stmf_sbd/sbd.c b/usr/src/uts/common/io/comstar/lu/stmf_sbd/sbd.c
index 60587bcdf6..88dee95fb8 100644
--- a/usr/src/uts/common/io/comstar/lu/stmf_sbd/sbd.c
+++ b/usr/src/uts/common/io/comstar/lu/stmf_sbd/sbd.c
@@ -2677,7 +2677,10 @@ sbd_modify_lu(sbd_modify_lu_t *mlu, int struct_sz, uint32_t *err_ret)
/* if there is data in the buf, null terminate it */
if (struct_sz > sizeof (*mlu)) {
- mlu->mlu_buf[struct_sz - sizeof (*mlu) + 8 - 1] = 0;
+ char *mlu_buf;
+
+ mlu_buf = &(mlu->mlu_buf[0]);
+ mlu_buf[struct_sz - sizeof (*mlu) + 8 - 1] = '\0';
}
*err_ret = 0;
@@ -2904,7 +2907,10 @@ sbd_set_global_props(sbd_global_props_t *mlu, int struct_sz,
/* if there is data in the buf, null terminate it */
if (struct_sz > sizeof (*mlu)) {
- mlu->mlu_buf[struct_sz - sizeof (*mlu) + 8 - 1] = 0;
+ char *mlu_buf;
+
+ mlu_buf = &(mlu->mlu_buf[0]);
+ mlu_buf[struct_sz - sizeof (*mlu) + 8 - 1] = '\0';
}
*err_ret = 0;