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

jeffrey putnam (JIRA) noreply at issues.asterisk.org
Mon Feb 2 15:31:35 CST 2015


jeffrey putnam created ASTERISK-24751:
-----------------------------------------

             Summary: 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.   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.   




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



More information about the asterisk-bugs mailing list