[sr-dev] [kamailio/kamailio] format-truncation warning (Issue #3013)

sergey-safarov notifications at github.com
Sat Jan 29 14:17:20 CET 2022


**1**
```
CC (gcc) [M presence.so]		notify.o
CC (gcc) [M presence.so]		presence.o
presence.c: In function 'child_init':
presence.c:570:62: warning: '%d' directive output may be truncated writing between 1 and 11 bytes into a region of size 3 [-Wformat-truncation=]
  570 |                         snprintf(tmp, 21, "PRESENCE NOTIFIER %d", i);
      |                                                              ^~
presence.c:570:43: note: directive argument in the range [-2147483647, 2147483646]
  570 |                         snprintf(tmp, 21, "PRESENCE NOTIFIER %d", i);
      |                                           ^~~~~~~~~~~~~~~~~~~~~~
presence.c:570:25: note: 'snprintf' output between 20 and 30 bytes into a destination of size 21
  570 |                         snprintf(tmp, 21, "PRESENCE NOTIFIER %d", i);
      |                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
CC (gcc) [M presence.so]		presence_dmq.o
CC (gcc) [M presence.so]		presentity.o
CC (gcc) [M presence.so]		publish.o
CC (gcc) [M presence.so]		subscribe.o
CC (gcc) [M presence.so]		utils_func.o
```
**2**
```
CC (gcc) [M rls.so]		resource_notify.o
CC (gcc) [M rls.so]		rls.o
rls.c: In function 'child_init':
rls.c:688:57: warning: '%d' directive output may be truncated writing between 1 and 11 bytes into a region of size 3 [-Wformat-truncation=]
  688 |                         snprintf(tmp, 16, "RLS NOTIFIER %d", i);
      |                                                         ^~
rls.c:688:43: note: directive argument in the range [-2147483647, 2147483646]
  688 |                         snprintf(tmp, 16, "RLS NOTIFIER %d", i);
      |                                           ^~~~~~~~~~~~~~~~~
rls.c:688:25: note: 'snprintf' output between 15 and 25 bytes into a destination of size 16
  688 |                         snprintf(tmp, 16, "RLS NOTIFIER %d", i);
      |                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
CC (gcc) [M rls.so]		rls_db.o
CC (gcc) [M rls.so]		subscribe.o
CC (gcc) [M rls.so]		utils.o
```


-- 
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/3013
You are receiving this because you are subscribed to this thread.

Message ID: <kamailio/kamailio/issues/3013 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kamailio.org/pipermail/sr-dev/attachments/20220129/dfa76b2a/attachment-0001.htm>


More information about the sr-dev mailing list