[Asterisk-code-review] chan_dahdi.c: Resolve a format-truncation build warning. (asterisk[16])

Sean Bright asteriskteam at digium.com
Fri Aug 19 11:06:22 CDT 2022


Sean Bright has uploaded this change for review. ( https://gerrit.asterisk.org/c/asterisk/+/18982 )


Change subject: chan_dahdi.c: Resolve a format-truncation build warning.
......................................................................

chan_dahdi.c: Resolve a format-truncation build warning.

> chan_dahdi.c:4129:18: error: ā€˜%sā€™ directive output may be truncated
>   writing up to 255 bytes into a region of size between 242 and 252
>   [-Werror=format-truncation=]

Change-Id: I2d276785286730d3d5d0a921bcea2e065dbf27c5
---
M channels/chan_dahdi.c
1 file changed, 1 insertion(+), 1 deletion(-)



  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/82/18982/1

diff --git a/channels/chan_dahdi.c b/channels/chan_dahdi.c
index 253c647..7353634 100644
--- a/channels/chan_dahdi.c
+++ b/channels/chan_dahdi.c
@@ -4128,7 +4128,7 @@
 {
 #define CHAN_TAG "Chan "
 	char logmsg[256];
-	char completemsg[sizeof(logmsg) + sizeof(CHAN_TAG) - 1];
+	char completemsg[sizeof(logmsg) + sizeof(CHAN_TAG "4294967295 - ") - 1];
 	vsnprintf(logmsg, sizeof(logmsg), fmt, ap);
 	snprintf(completemsg, sizeof(completemsg), CHAN_TAG "%d - %s", openr2_chan_get_number(r2chan), logmsg);
 	dahdi_r2_write_log(level, completemsg);

-- 
To view, visit https://gerrit.asterisk.org/c/asterisk/+/18982
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: 16
Gerrit-Change-Id: I2d276785286730d3d5d0a921bcea2e065dbf27c5
Gerrit-Change-Number: 18982
Gerrit-PatchSet: 1
Gerrit-Owner: Sean Bright <sean at seanbright.com>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20220819/eb18a2db/attachment.html>


More information about the asterisk-code-review mailing list