modem: modem_cellular: CID 338073

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:13:07 +01:00 committed by Henrik Brix Andersen
parent 08a51bae89
commit b668296a50

View file

@ -301,7 +301,7 @@ static void modem_cellular_chat_on_imei(struct modem_chat *chat, char **argv, ui
return;
}
strncpy(data->imei, argv[1], sizeof(data->imei));
strncpy(data->imei, argv[1], sizeof(data->imei) - 1);
}
static void modem_cellular_chat_on_cgmm(struct modem_chat *chat, char **argv, uint16_t argc,