[asterisk-bugs] [JIRA] Created: (ASTERISK-20377) iax2 provisioning cache mismanaged

Rusty Newton (JIRA) noreply at issues.asterisk.org
Thu Sep 6 17:13:07 CDT 2012


iax2 provisioning cache mismanaged
----------------------------------

                 Key: ASTERISK-20377
                 URL: https://issues.asterisk.org/jira/browse/ASTERISK-20377
             Project: Asterisk
          Issue Type: Bug
      Security Level: None
          Components: Channels/chan_iax2
    Affects Versions: 10.7.0
         Environment: All.  (running on Mac OSX 10.4.11 Power PC)
            Reporter: John Covert


On load, iax2-provision.c routine iax_provision_reload deletes the iax/provisioning/cache tree.  This is good.

Later, when routine iax_provision_version attempts to retrieve the cache entry, the call to ast_db_get is not handled correctly.  ast_db_get returns 0 on success and -1 on failure.  The existing code treats success as failure and vice versa.  As a result, the first call fails, and is treated as success.  The subsequent version check fails, and the cache entry is created.  From now on, each call to ast_db_get succeeds and returns 0 which is treated as a failure and reported.

With the attached patch, the test on the call to ast_db_get is properly handled.  However, since there will always be a failure after reload, the unlock and return must not be done.  Instead, we simply report the error the first time (a correct report, since the cache retrieval did not happen) and go on and build the entry.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira



More information about the asterisk-bugs mailing list