Author: mav Date: Fri Jul 4 16:17:15 2014 New Revision: 268262 URL: http://svnweb.freebsd.org/changeset/base/268262
Log: 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. Modified: stable/10/usr.sbin/ctld/kernel.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/ctld/kernel.c ============================================================================== --- stable/10/usr.sbin/ctld/kernel.c Fri Jul 4 16:11:30 2014 (r268261) +++ stable/10/usr.sbin/ctld/kernel.c Fri Jul 4 16:17:15 2014 (r268262) @@ -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; } _______________________________________________ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"