modem: modem_cellular: CID 338140

incorrect size passed to strncpy

Signed-off-by: Bjarki Arge Andreasen <bjarki@arge-andreasen.me>
This commit is contained in:
Bjarki Arge Andreasen 2024-02-12 17:11:42 +01:00 committed by Henrik Brix Andersen
parent adcdf64a0f
commit ae951f5f02

View file

@ -325,7 +325,7 @@ static void modem_cellular_chat_on_cgmi(struct modem_chat *chat, char **argv, ui
return;
}
strncpy(data->manufacturer, argv[1], sizeof(data->manufacturer));
strncpy(data->manufacturer, argv[1], sizeof(data->manufacturer) - 1);
}
static void modem_cellular_chat_on_cgmr(struct modem_chat *chat, char **argv, uint16_t argc,