[asterisk-bugs] [JIRA] (ASTERISK-24751) Integer values in json payload to ARI cause asterisk to crash

Rusty Newton (JIRA) noreply at issues.asterisk.org
Mon Feb 2 16:09:34 CST 2015


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

Rusty Newton updated ASTERISK-24751:
------------------------------------

    Description: 
Sending the following request to asterisk via ari causes asterisk to crash.

{noformat}
def do_one_call(call_to='SIP/666', sleeptime=10) :
    channel_base= str(uuid4())

    params = {
                'endpoint' : "SIP/666",
                'channelId' : channel_base,
                'extension' : '200',
                'priority' : '1',
                'context' : 'testphone', # this exists 
             }

    vars = {
             "variables" : {
                   "digits" : "1217",
                   "code" : "3567",
                   "language" : "en-US",
                   "foo" : 1,
           } }

    headers = {"content-type" : "application/json" }
    request = post(url, params=params, data=json.dumps(vars), auth=auth, headers=headers)
do_one_call()
{noformat}

I have a properly registered and running sip phone at 666.  

Extensions.conf context testphone has this at extension 200 : 

{noformat}
exten => 200,1,NoOp(testphone 200)
 same =>     n,Answer()
 same =>     n,Playback(silence/4)
 same =>     n,Hangup()
 same =>     n,NoOp(testphone 200 done)
{noformat}

Changing the value of "foo" above to "1" and everthing works.   gdb on the core dump shows asterisk failing at config.c:290 in trying to evalue strlen of a null value.   

Workaround - make sure all parameters in json payload are passed in as strings.   


  was:
Sending the following request to asterisk via ari causes asterisk to crash.   def do_one_call(call_to='SIP/666', sleeptime=10) :
    channel_base= str(uuid4())

    params = {
                'endpoint' : "SIP/666",
                'channelId' : channel_base,
                'extension' : '200',
                'priority' : '1',
                'context' : 'testphone', # this exists 
             }

    vars = {
             "variables" : {
                   "digits" : "1217",
                   "code" : "3567",
                   "language" : "en-US",
                   "foo" : 1,
           } }

    headers = {"content-type" : "application/json" }
    request = post(url, params=params, data=json.dumps(vars), auth=auth, headers=headers)
do_one_call()

I have a properly registered and running sip phone at 666.  

Extensions.conf context testphone has this at extension 200 : 

exten => 200,1,NoOp(testphone 200)
 same =>     n,Answer()
 same =>     n,Playback(silence/4)
 same =>     n,Hangup()
 same =>     n,NoOp(testphone 200 done)

Changing the value of "foo" above to "1" and everthing works.   gdb on the core dump shows asterisk failing at config.c:290 in trying to evalue strlen of a null value.   

Workaround - make sure all parameters in json payload are passed in as strings.   



> Integer values in json payload to ARI cause asterisk to crash
> -------------------------------------------------------------
>
>                 Key: ASTERISK-24751
>                 URL: https://issues.asterisk.org/jira/browse/ASTERISK-24751
>             Project: Asterisk
>          Issue Type: Bug
>      Security Level: None
>    Affects Versions: 13.0.2
>         Environment: Linux (both ubuntu and centos).  
>            Reporter: jeffrey putnam
>
> Sending the following request to asterisk via ari causes asterisk to crash.
> {noformat}
> def do_one_call(call_to='SIP/666', sleeptime=10) :
>     channel_base= str(uuid4())
>     params = {
>                 'endpoint' : "SIP/666",
>                 'channelId' : channel_base,
>                 'extension' : '200',
>                 'priority' : '1',
>                 'context' : 'testphone', # this exists 
>              }
>     vars = {
>              "variables" : {
>                    "digits" : "1217",
>                    "code" : "3567",
>                    "language" : "en-US",
>                    "foo" : 1,
>            } }
>     headers = {"content-type" : "application/json" }
>     request = post(url, params=params, data=json.dumps(vars), auth=auth, headers=headers)
> do_one_call()
> {noformat}
> I have a properly registered and running sip phone at 666.  
> Extensions.conf context testphone has this at extension 200 : 
> {noformat}
> exten => 200,1,NoOp(testphone 200)
>  same =>     n,Answer()
>  same =>     n,Playback(silence/4)
>  same =>     n,Hangup()
>  same =>     n,NoOp(testphone 200 done)
> {noformat}
> Changing the value of "foo" above to "1" and everthing works.   gdb on the core dump shows asterisk failing at config.c:290 in trying to evalue strlen of a null value.   
> Workaround - make sure all parameters in json payload are passed in as strings.   



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



More information about the asterisk-bugs mailing list