[asterisk-bugs] [JIRA] (ASTERISK-27021) GET /recordings/stored returns 500 Internal Server Error

Friendly Automation (JIRA) noreply at issues.asterisk.org
Thu Jun 1 11:00:57 CDT 2017


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

Friendly Automation commented on ASTERISK-27021:
------------------------------------------------

Change 5740 merged by Jenkins2:
stasis_recording: Correct ast_asprintf error checking

[https://gerrit.asterisk.org/5740|https://gerrit.asterisk.org/5740]

> GET /recordings/stored returns 500 Internal Server Error
> --------------------------------------------------------
>
>                 Key: ASTERISK-27021
>                 URL: https://issues.asterisk.org/jira/browse/ASTERISK-27021
>             Project: Asterisk
>          Issue Type: Bug
>      Security Level: None
>          Components: Resources/res_ari_recordings
>    Affects Versions: 14.4.0
>         Environment: Asterisk 14.4, Centos 7
>            Reporter: Tim Morgan
>            Severity: Critical
>
> Performing a GET on /recordings/stored fails, returning HTTP error code 500, Internal Server Error.
> I determined that the problem is with this line:
> {noformat}
>     if (ast_asprintf(&filepath, "%s/%s", dir_name, filename) ) {
>                 return -1;
>     }
> {noformat}
> in res/stasis_recording/stored.c, handle_scan_file().  Because ast_asprintf() returns a positive value when it is successful, this test incorrectly causes handle_scan_file to return -1.  I suspect it also causes a memory leak, since ast_asprintf() has successfully allocated some memory but it's believed to have failed.  After changing the test to:
> {noformat}
>     if (ast_asprintf(&filepath, "%s/%s", dir_name, filename) < 0) {
> {noformat}
> then "GET /recordings/stored" worked for me.
> I haven't tried this GET operation with earlier versions, so I don't know when the problem was introduced.



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



More information about the asterisk-bugs mailing list