diff options
author | mav <mav@FreeBSD.org> | 2014-07-04 16:17:15 +0000 |
---|---|---|
committer | mav <mav@FreeBSD.org> | 2014-07-04 16:17:15 +0000 |
commit | 3b926638cff95aa21a2b08dd5139d30a4f181d08 (patch) | |
tree | 5aeb3b021c340529cf3020e3e7f4852f6bdea16c /usr.sbin/ctld | |
parent | dc2d4784261ff6d0617346587ea3c0dc306b14a7 (diff) | |
download | FreeBSD-src-3b926638cff95aa21a2b08dd5139d30a4f181d08.zip FreeBSD-src-3b926638cff95aa21a2b08dd5139d30a4f181d08.tar.gz |
MFC r267648:
serial_num and device_id fields are not necessarily null-terminated.
Before this it was impossible to use all 16 bytes of serial number, and
client always got serial number NULL-terminated, that is not required.
Diffstat (limited to 'usr.sbin/ctld')
-rw-r--r-- | usr.sbin/ctld/kernel.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.sbin/ctld/kernel.c b/usr.sbin/ctld/kernel.c index ad83679..a8799f8 100644 --- a/usr.sbin/ctld/kernel.c +++ b/usr.sbin/ctld/kernel.c @@ -413,13 +413,13 @@ kernel_lun_add(struct lun *lun) req.reqdata.create.device_type = T_DIRECT; if (lun->l_serial != NULL) { - strlcpy(req.reqdata.create.serial_num, lun->l_serial, + strncpy(req.reqdata.create.serial_num, lun->l_serial, sizeof(req.reqdata.create.serial_num)); req.reqdata.create.flags |= CTL_LUN_FLAG_SERIAL_NUM; } if (lun->l_device_id != NULL) { - strlcpy(req.reqdata.create.device_id, lun->l_device_id, + strncpy(req.reqdata.create.device_id, lun->l_device_id, sizeof(req.reqdata.create.device_id)); req.reqdata.create.flags |= CTL_LUN_FLAG_DEVID; } |