<p>Patch set 1:<span style="border-radius: 3px; display: inline-block; margin: 0 2px; padding: 4px;background-color: #ffd4d4; color: #000000;">Code-Review -1</span></p><p><a href="https://gerrit.asterisk.org/c/asterisk/+/14501">View Change</a></p><p>1 comment:</p><ul style="list-style: none; padding: 0;"><li style="margin: 0; padding: 0;"><p><a href="https://gerrit.asterisk.org/c/asterisk/+/14501/1/main/say.c">File main/say.c:</a></p><ul style="list-style: none; padding: 0;"><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/c/asterisk/+/14501/1/main/say.c@2371">Patch Set #1, Line 2371:</a> <code style="font-family:monospace,monospace">                               snprintf(buf, 12, "%d", num);</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">I find it odd it's not complaining about the other similar conversions. For instance another exact same snprintf is just a few lines below this one in another "if".</p><p style="white-space: pre-wrap; word-wrap: break-word;">Also I wager it's fixed by bumping the 'n' value to 12 due to the compiler thinking that's the max size for an int conversion? Is that for 32-bit? Seemingly 64-bit would need to be bigger?</p><p style="white-space: pre-wrap; word-wrap: break-word;">From what I've read the compiler is complaining about this because the number copied might be truncated, which if so could cause an error. However, there is no check on the snprintf result to see if that's the case.</p><p style="white-space: pre-wrap; word-wrap: break-word;">I think to fix this "buf" needs to be enlarged some (32?), and the 'n' value increased to sizeof(buf) - 1. That should ensure signed larger numbers are not truncated on different architectures for some implementation of "int" and hopefully avoids the warning.</p><p style="white-space: pre-wrap; word-wrap: break-word;">Alternatively, or even better, but maybe not necessary here is also checking the return value and making sure there is no truncation error/problem.</p></li></ul></li></ul><p>To view, visit <a href="https://gerrit.asterisk.org/c/asterisk/+/14501">change 14501</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.asterisk.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.asterisk.org/c/asterisk/+/14501"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: 13 </div>
<div style="display:none"> Gerrit-Change-Id: Ic7a70120188c9aa525a6d70289385bfce878438a </div>
<div style="display:none"> Gerrit-Change-Number: 14501 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Walter Doekes <walter+asterisk@wjd.nu> </div>
<div style="display:none"> Gerrit-Reviewer: Friendly Automation </div>
<div style="display:none"> Gerrit-Reviewer: George Joseph <gjoseph@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Kevin Harwell <kharwell@digium.com> </div>
<div style="display:none"> Gerrit-Comment-Date: Mon, 22 Jun 2020 17:44:58 +0000 </div>
<div style="display:none"> Gerrit-HasComments: Yes </div>
<div style="display:none"> Gerrit-Has-Labels: Yes </div>
<div style="display:none"> Gerrit-MessageType: comment </div>