[asterisk-bugs] [JIRA] (ASTERISK-30492) app_queue periodic-announce-startdelay patch derefferences null qe.parent pointer.

Asterisk Team (JIRA) noreply at issues.asterisk.org
Tue Apr 11 17:56:03 CDT 2023


    [ https://issues.asterisk.org/jira/browse/ASTERISK-30492?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=261756#comment-261756 ] 

Asterisk Team commented on ASTERISK-30492:
------------------------------------------

WARNING

JIRA will be going read-only at the end of April, 2023. We will be starting fresh on Github at https://github.com/asterisk/asterisk at that time. No issues or patches will be copied to Github. If you file an issue on JIRA at this time you will need to recreate it on Github after this date. The same applies if you have a patch.

WARNING

Thanks for creating a report! The issue has entered the triage process. That means the issue will wait in this status until a Bug Marshal has an opportunity to review the issue. Once the issue has been reviewed you will receive comments regarding the next steps towards resolution. Please note that log messages and other files should not be sent to the Sangoma Asterisk Team unless explicitly asked for. All files should be placed on this issue in a sanitized fashion as needed.

A good first step is for you to review the [Asterisk Issue Guidelines|https://wiki.asterisk.org/wiki/display/AST/Asterisk+Issue+Guidelines] if you haven't already. The guidelines detail what is expected from an Asterisk issue report.

Then, if you are submitting a patch, please review the [Patch Contribution Process|https://wiki.asterisk.org/wiki/display/AST/Patch+Contribution+Process].

Please note that once your issue enters an open state it has been accepted. As Asterisk is an open source project there is no guarantee or timeframe on when your issue will be looked into. If you need expedient resolution you will need to find and pay a suitable developer. Asking for an update on your issue will not yield any progress on it and will not result in a response. All updates are posted to the issue when they occur.

Please note that by submitting data, code, or documentation to Sangoma through JIRA, you accept the Terms of Use present at [https://www.asterisk.org/terms-of-use/|https://www.asterisk.org/terms-of-use/].

> app_queue periodic-announce-startdelay patch derefferences null qe.parent pointer.
> ----------------------------------------------------------------------------------
>
>                 Key: ASTERISK-30492
>                 URL: https://issues.asterisk.org/jira/browse/ASTERISK-30492
>             Project: Asterisk
>          Issue Type: Bug
>      Security Level: None
>          Components: Applications/app_queue
>    Affects Versions: GIT
>         Environment: RHEL 8 (for clang-tidy), Ubuntu 22.04 (for manual test), but really this is universal anyway.
>            Reporter: Jonathan Rose
>            Severity: Major
>
> https://issues.asterisk.org/jira/browse/ASTERISK-30437
> Clang Tidy reported this patch with 'warning: Dereference of null pointer' -- that prompted me to look into the change further and that left me wondering whether or not this patch was actually tested before it was committed.
> Per my comment, https://github.com/asterisk/asterisk/blob/edd7f1b0605e2840b2e21bf45afa67950dd3f9fe/apps/app_queue.c#L8529 -- at this point, qe.parent will unconditionally be null since it is qe is initialized via:
> struct queue_ent qe = { 0 };
> From here you have some individual members of qe being set, but qe.parent isn't set at any point until after we enter the queue_join function. Presumably at this point qe.parent is going to be a null pointer, and we can't use that to get the periodicannouncestartdelay without causing a segfault.
> My testing confirms that running the Queue dialplan application now pretty much unconditionally causes a segfault.
> As far as I can tell, this is the *only* place that periodicannouncestartdelay is consumed, hence my comment about this seeming to be code that was committed without any kind of testing. There's no way it ever could have worked.
> ```
> queue_exec (chan=0x555555f57c00, data=0x7fffa85999b0 "testqueue") at app_queue.c:8530
> 8530            if (qe.parent->periodicannouncestartdelay >= 0) {
> (gdb) bt
> #0  queue_exec (chan=0x555555f57c00, data=0x7fffa85999b0 "testqueue") at app_queue.c:8530
> #1  0x00005555556e25e3 in pbx_exec (c=0x555555f57c00, app=0x555555f07990, data=0x7fffa85999b0 "testqueue") at pbx_app.c:492
> ```
> I don't understand why this wasn't already caught by continuous integration since I would presume that this will cause the asterisk testsuite to fail on any of the queue tests. My insight into how CI is ran in relation to pull requests isn't quite what it used to be admittedly.



--
This message was sent by Atlassian JIRA
(v6.2#6252)



More information about the asterisk-bugs mailing list