[asterisk-bugs] [JIRA] (ASTERISK-30256) chan_dahdi: Fix format truncation warnings
Asterisk Team (JIRA)
noreply at issues.asterisk.org
Thu Dec 15 07:08:01 CST 2022
[ https://issues.asterisk.org/jira/browse/ASTERISK-30256?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Asterisk Team updated ASTERISK-30256:
-------------------------------------
Target Release Version/s: 18.16.0
> chan_dahdi: Fix format truncation warnings
> ------------------------------------------
>
> Key: ASTERISK-30256
> URL: https://issues.asterisk.org/jira/browse/ASTERISK-30256
> Project: Asterisk
> Issue Type: Bug
> Security Level: None
> Components: Channels/chan_dahdi
> Affects Versions: 18.14.0
> Reporter: N A
> Assignee: N A
> Severity: Major
> Target Release: 16.30.0, 18.16.0, 19.8.0, 20.1.0
>
>
> Fixes format truncation warning with newer gcc:
> {noformat}
> chan_dahdi.c: In function ‘analog_ss_thread’:
> chan_dahdi.c:3466:33: warning: ‘%d’ directive output may be truncated writing 1 byte into a region of size between 0 and 4256 [-Wformat-truncation=]
> 3466 | snprintf(s, sizeof(s), "%s %s %d", mwimonitornotify, mailbox, thereornot);
> | ^~
> In file included from /usr/include/stdio.h:867,
> from /usr/src/asterisk-18.14.0/include/asterisk/compat.h:49,
> from /usr/src/asterisk-18.14.0/include/asterisk.h:22,
> from chan_dahdi.c:55:
> /usr/include/x86_64-linux-gnu/bits/stdio2.h:67:10: note: ‘__builtin___snprintf_chk’ output between 4 and 4260 bytes into a destination of size 4258
> 67 | return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1,
> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> 68 | __bos (__s), __fmt, __va_arg_pack ());
> | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> chan_dahdi.c:3466:33: warning: ‘%d’ directive output may be truncated writing 1 byte into a region of size between 0 and 4256 [-Wformat-truncation=]
> 3466 | snprintf(s, sizeof(s), "%s %s %d", mwimonitornotify, mailbox, thereornot);
> | ^~
> In file included from /usr/include/stdio.h:867,
> from /usr/src/asterisk-18.14.0/include/asterisk/compat.h:49,
> from /usr/src/asterisk-18.14.0/include/asterisk.h:22,
> from chan_dahdi.c:55:
> /usr/include/x86_64-linux-gnu/bits/stdio2.h:67:10: note: ‘__builtin___snprintf_chk’ output between 4 and 4260 bytes into a destination of size 4258
> 67 | return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1,
> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> 68 | __bos (__s), __fmt, __va_arg_pack ());
> | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> [LD] chan_dahdi.o dahdi/bridge_native_dahdi.o sig_analog.o sig_pri.o sig_ss7.o -> chan_dahdi.so
> {noformat}
--
This message was sent by Atlassian JIRA
(v6.2#6252)
More information about the asterisk-bugs
mailing list