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

George Joseph (JIRA) noreply at issues.asterisk.org
Thu Jul 6 07:12:09 CDT 2017


     [ https://issues.asterisk.org/jira/browse/ASTERISK-27021?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

George Joseph updated ASTERISK-27021:
-------------------------------------

    Target Release Version/s: 14.6.0

> 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
>      Target Release: 13.17.0, 14.6.0
>
>
> 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