Module: kamailio
Branch: 5.1
Commit: 37d56a80ac28acb35190016f3459c4f85c4fdc81
URL:
https://github.com/kamailio/kamailio/commit/37d56a80ac28acb35190016f3459c4f…
Author: Victor Seva <linuxmaniac(a)torreviejawireless.org>
Committer: Victor Seva <linuxmaniac(a)torreviejawireless.org>
Date: 2017-12-15T11:51:41+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);
~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
(cherry picked from commit 537a40b4745099f3265242377c39057a680fc3ee)
---
Modified: src/modules/sms/libsms_modem.c
---
Diff:
https://github.com/kamailio/kamailio/commit/37d56a80ac28acb35190016f3459c4f…
Patch:
https://github.com/kamailio/kamailio/commit/37d56a80ac28acb35190016f3459c4f…
---
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;