Do not truncate the last character from serial number.
strlcpy() requires one more byte for the NULL character. Submitted by: Henri Hennebert (hlh at restart dot be) MFC after: 3 days
This commit is contained in:
parent
e6b9cee76b
commit
7e06495b9b
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=367997
@ -1306,12 +1306,12 @@ sdda_start_init(void *context, union ccb *start_ccb)
|
||||
device->serial_num_len = strlen(softc->card_sn_string);
|
||||
device->serial_num = (u_int8_t *)malloc((device->serial_num_len + 1),
|
||||
M_CAMXPT, M_NOWAIT);
|
||||
strlcpy(device->serial_num, softc->card_sn_string, device->serial_num_len);
|
||||
strlcpy(device->serial_num, softc->card_sn_string, device->serial_num_len + 1);
|
||||
|
||||
device->device_id_len = strlen(softc->card_id_string);
|
||||
device->device_id = (u_int8_t *)malloc((device->device_id_len + 1),
|
||||
M_CAMXPT, M_NOWAIT);
|
||||
strlcpy(device->device_id, softc->card_id_string, device->device_id_len);
|
||||
strlcpy(device->device_id, softc->card_id_string, device->device_id_len + 1);
|
||||
|
||||
strlcpy(mmcp->model, softc->card_id_string, sizeof(mmcp->model));
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user