[asterisk-bugs] [JIRA] (ASTERISK-28095) Asterisk crashes when calling an ODBC function from another ODBC function

Richard Mudgett (JIRA) noreply at issues.asterisk.org
Mon Oct 8 17:09:54 CDT 2018


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

Richard Mudgett commented on ASTERISK-28095:
--------------------------------------------

I see what's going on.  We have thread local storage buffers that are being used recursively in this case.  When the internal ODBC function returns the code doesn't know that the outer buffer data is stale and we crash.  We'll definitely need a buffer for each ODBC function invocation.

I'm acknowledging the issue.

> Asterisk crashes when calling an ODBC function from another ODBC function
> -------------------------------------------------------------------------
>
>                 Key: ASTERISK-28095
>                 URL: https://issues.asterisk.org/jira/browse/ASTERISK-28095
>             Project: Asterisk
>          Issue Type: Bug
>      Security Level: None
>          Components: Functions/func_odbc
>    Affects Versions: 16.0.0
>            Reporter: Niksa Baldun
>            Assignee: Unassigned
>            Severity: Minor
>         Attachments: core-ASTERISK-28095-results.tar.gz
>
>
> Steps to reproduce:
> Create the following database table (I am using Postgres, but the database server is likely irrelevant):
> {code:sql}
> CREATE TABLE setting (
>     name text NOT NULL,
>     value text NOT NULL,
>     CONSTRAINT setting_unique UNIQUE (name)
> );
> {code}
> Put the following in func_odbc.conf:
> {code:sql}
> [GET]
> prefix=SETTING
> dsn=PBX
> readsql=SELECT value FROM setting WHERE name = '${ARG1}'
> [RESOLVE]
> prefix=SETTING
> dsn=PBX
> readsql=SELECT '${SETTING_GET(${ARG1})}' AS value
> {code}
> When you call {noformat}${SETTING_RESOLVE(somesetting)}{noformat} from dialplan, Asterisk crashes. Calling one function from another may or may not make sense, but I think Asterisk should not crash even if this is not supported.



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



More information about the asterisk-bugs mailing list