mirror of git://git.sysmocom.de/ofono
atmodem: enlarge command buffer
The ofono phone number max length is 80 so a buffer size of 64 is obviously insufficient. Expanding the buffer to 128 prevents a potential failure and suppresses the folowing compiler warning: ../drivers/atmodem/sms.c: In function ‘at_csca_set’: ../drivers/atmodem/sms.c:108:40: warning: ‘%s’ directive output may be truncated writing up to 80 bytes into a region of size 55 [-Wformat-truncation=] snprintf(buf, sizeof(buf), "AT+CSCA=\"%s\",%d", sca->number, sca->type); ^~ ../drivers/atmodem/sms.c:108:2: note: ‘snprintf’ output between 13 and 103 bytes into a destination of size 64 snprintf(buf, sizeof(buf), "AT+CSCA=\"%s\",%d", sca->number, sca->type); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This commit is contained in:
parent
85cf3c8aa9
commit
1e176755af
|
@ -103,7 +103,7 @@ static void at_csca_set(struct ofono_sms *sms,
|
|||
{
|
||||
struct sms_data *data = ofono_sms_get_data(sms);
|
||||
struct cb_data *cbd = cb_data_new(cb, user_data);
|
||||
char buf[64];
|
||||
char buf[128];
|
||||
|
||||
snprintf(buf, sizeof(buf), "AT+CSCA=\"%s\",%d", sca->number, sca->type);
|
||||
|
||||
|
|
Loading…
Reference in New Issue