[Asterisk-code-review] GCC12: Fixes for 16+ (asterisk[16])

George Joseph asteriskteam at digium.com
Thu May 5 09:59:24 CDT 2022


Attention is currently required from: Kevin Harwell.
George Joseph has posted comments on this change. ( https://gerrit.asterisk.org/c/asterisk/+/18529 )

Change subject: GCC12: Fixes for 16+
......................................................................


Patch Set 1:

(1 comment)

File apps/app_festival.c:

https://gerrit.asterisk.org/c/asterisk/+/18529/comment/3af741ae_b4b2d9c8 
PS1, Line 436: 	if (strlen(cachedir) + sizeof(MD5Hex) + 1 <= MAXFESTLEN && (usecache == -1)) {
> For 1) I'm saying strlen(x) will always be at least one less (possibly more) than sizeof(x). That could be the difference in the check here being true/false when it wasn't previously. That said if MD5Hex is guaranteed to always be 32 bytes here then it may be a moot point in this scenario.

This isn't a true/false issue.  It's a buffer overflow issue.  An MD5 checksum is always 16 bytes and when represented in hex characters, it's always 32.  The compiler doesn't know that though and the bits that are checking for the overflow see "strlen" and assume it can be 0.   I do believe it's a bug in the compiler but it is what it is.  Maybe it's the usecache part of the predicate that's confusing the code that evaluates guard conditions.



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

Gerrit-Project: asterisk
Gerrit-Branch: 16
Gerrit-Change-Id: Ia081ca1bcfb329df6487c4660aaf1944309eb570
Gerrit-Change-Number: 18529
Gerrit-PatchSet: 1
Gerrit-Owner: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Friendly Automation
Gerrit-Reviewer: Kevin Harwell <kharwell at digium.com>
Gerrit-Reviewer: Michael Bradeen <mbradeen at sangoma.com>
Gerrit-Attention: Kevin Harwell <kharwell at digium.com>
Gerrit-Comment-Date: Thu, 05 May 2022 14:59:24 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: George Joseph <gjoseph at digium.com>
Comment-In-Reply-To: Kevin Harwell <kharwell at digium.com>
Gerrit-MessageType: comment
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20220505/bd41c64c/attachment-0001.html>


More information about the asterisk-code-review mailing list