Module: kamailio
Branch: master
Commit: 76868e6dd437769305d3425077d60594f62e10c5
URL:
https://github.com/kamailio/kamailio/commit/76868e6dd437769305d3425077d6059…
Author: Victor Seva <linuxmaniac(a)torreviejawireless.org>
Committer: Victor Seva <linuxmaniac(a)torreviejawireless.org>
Date: 2017-12-15T11:44:03+01:00
sms: fix gcc 7 warning #1369
CC (gcc) [M sms.so] libsms_modem.o
libsms_modem.c: In function 'initmodem':
libsms_modem.c:230:36: warning: '%s' directive writing up to 128 bytes into a
region of size 91 [-Wformat-overflow=]
clen=sprintf(command,"AT+CPIN=\"%s\"\r",mdm->pin);
^~
libsms_modem.c:230:8: note: 'sprintf' output between 12 and 140 bytes into a
destination of size 100
clen=sprintf(command,"AT+CPIN=\"%s\"\r",mdm->pin);
~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
---
Modified: src/modules/sms/libsms_modem.c
---
Diff:
https://github.com/kamailio/kamailio/commit/76868e6dd437769305d3425077d6059…
Patch:
https://github.com/kamailio/kamailio/commit/76868e6dd437769305d3425077d6059…
---
diff --git a/src/modules/sms/libsms_modem.c b/src/modules/sms/libsms_modem.c
index 7bf702f6c7..5093d28ee2 100644
--- a/src/modules/sms/libsms_modem.c
+++ b/src/modules/sms/libsms_modem.c
@@ -213,7 +213,7 @@ int setmodemparams( struct modem *mdm )
int initmodem(struct modem *mdm, cds_report cds_report_f)
{
- char command[100];
+ char command[MAX_CHAR_BUF+12];
char answer[100];
int retries=0;
int success=0;