[Asterisk-code-review] term.c: Truncate the message rather than the escape sequences. (asterisk[master])
Sean Bright
asteriskteam at digium.com
Thu Nov 11 13:52:32 CST 2021
Attention is currently required from: Jaco Kroon.
Sean Bright has posted comments on this change. ( https://gerrit.asterisk.org/c/asterisk/+/17333 )
Change subject: term.c: Truncate the message rather than the escape sequences.
......................................................................
Patch Set 1:
(1 comment)
File main/term.c:
https://gerrit.asterisk.org/c/asterisk/+/17333/comment/087f6002_1fa61e8e
PS1, Line 276: if (offset < 0) {
: /* If we get here, the passed buffer is comically undersized, so just
: gracefully bail out */
: ast_copy_string(outbuf, inbuf, maxout);
: return outbuf;
: }
FWIW - I really wanted to make this an assertion rather than an if statement, but it covers the case where you pass in a crazy small buffer. You might still end up with wonky escape sequences but that - in my opinion - would be a bug in the caller, not this code.
--
To view, visit https://gerrit.asterisk.org/c/asterisk/+/17333
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings
Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-Change-Id: Ie460acf577faeb4a6d74062e22ea9f3ffd3233de
Gerrit-Change-Number: 17333
Gerrit-PatchSet: 1
Gerrit-Owner: Sean Bright <sean at seanbright.com>
Gerrit-Reviewer: Friendly Automation
Gerrit-Reviewer: Jaco Kroon <jaco at uls.co.za>
Gerrit-Attention: Jaco Kroon <jaco at uls.co.za>
Gerrit-Comment-Date: Thu, 11 Nov 2021 19:52:32 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20211111/f49176c8/attachment.html>
More information about the asterisk-code-review
mailing list