Skip to content
Snippets Groups Projects
  1. Jun 10, 2015
  2. Jun 09, 2015
  3. Jun 08, 2015
    • Corey Farrell's avatar
      Fix unsafe uses of ast_context pointers. · 80621ce3
      Corey Farrell authored
      Although ast_context_find, ast_context_find_or_create and
      ast_context_destroy perform locking of the contexts table,
      any context pointer can become invalid at any time that the
      contexts table is unlocked. This change adds locking around
      all complete operations involving these functions.
      
      Places where ast_context_find was followed by ast_context_destroy
      have been replaced with calls ast_context_destroy_by_name.
      
      ASTERISK-25094 #close
      Reported by: Corey Farrell
      
      Change-Id: I1866b6787730c9c4f3f836b6133ffe9c820734fa
      80621ce3
    • Kevin Harwell's avatar
      AMI: Escape string values. · 53c11260
      Kevin Harwell authored
      So this issue is a bit complicated. Since it is possible to pass values to AMI
      that contain a '\r\n' (or other similar sequences) these values need to be
      escaped. One way to solve this is to escape the values and then pass the escaped
      values to the AMI variable parameter string building function. However, this
      puts the onus on the pre-build function to escape all string values. This
      potentially requires a fair amount of changes along with a lot of string
      allocations/freeing for all values.
      
      Surely there is a way to push this complexity down a level into the string
      building function itself? This of course is possible, but ends up requiring a
      way to distinguish between strings that need to be escaped and those that don't.
      The best way to handle this is by introducing a new format specifier in the
      format string. For instance a %s (no escape) and %S (escape). However, that is
      a bit weird and unexpected.
      
      So faced with those possibilities this patch implements a limited version of the
      first option. Instead of attempting to escape all string values this patch only
      escapes those values that make sense. This approach limits the number of changes
      and doesn't suffer from the odd format specifier problem.
      
      ASTERISK-24934 #close
      Reported by: warren smith
      
      Change-Id: Ib55a5b84fe0481b0f2caaaab68c566f392c0aac0
      53c11260
  4. Jun 05, 2015
  5. Jun 04, 2015
    • Joshua Colp's avatar
      res_sorcery_memory_cache: Implement expire_on_reload option. · 128fe4ce
      Joshua Colp authored
      This change implements the expire_on_reload option for memory caches.
      If enabled and a reload is performed all objects within the cache
      will be expired and the cache emptied.
      
      ASTERISK-25067
      Reported by: Matt Jordan
      
      Change-Id: Id46aa1957d660556700e689e195eed57c989b85e
      128fe4ce
    • Joshua Colp's avatar
      test_sorcery_memory_cache_thrash: Add unit tests for thrashing the memory cache. · 028edae8
      Joshua Colp authored
      This change adds a CLI command which can perform memory cache thrashing as well
      as unit tests which perform thrashing under the following configurations:
      
      1. Low number of unique objects that go stale after 1 second
      2. Low number of unique objects that expire after 1 second
      3. Low number of unique objects which are constantly updated
      4. Large number of unique objects which exceed a defined cache size
      5. Large number of unique objects which exceed a defined cache size
         that also expire and go stale rapidly
      6. Large number of unique objects which expire and go stale rapidly
      7. Large number of unique objects
      
      For all of the above there are a large number of threads constantly
      attempting to retrieve random objects and each test runs for a few
      seconds.
      
      ASTERISK-25067
      Reported by: Matt Jordan
      
      Change-Id: I8c8ceff977332c80ed4a31f10d694d48552b2f78
      028edae8
    • Mark Michelson's avatar
    • Matt Jordan's avatar
      269fbff3
    • Joshua Colp's avatar
      res_sorcery_memory_cache: Add test event when a refresh occurs. · 19de2bbc
      Joshua Colp authored
      This change adds a testsuite event for when a refresh occurs.
      This is useful as it provides a guaranteed mechanism of knowing when
      it has occurred instead of waiting an arbitrary amount of time.
      
      ASTERISK-25067
      Reported by: Matt Jordan
      
      Change-Id: Iaa6b8d2d6bab7f99ee08e1c8908b8272a8987e65
      19de2bbc
  6. Jun 03, 2015
    • Mark Michelson's avatar
      res_pjsip: Prevent access of NULL channels. · 92ccffd9
      Mark Michelson authored
      It is possible to receive incoming requests or responses after the channel
      on an ast_sip_session has been destroyed and NULLed out. Handlers of these
      sorts of requests or responses need to be prepared for the possibility
      that the channel is NULL or else they could cause a crash.
      
      While several places have been amended to deal with NULL channels, there
      were still a couple of places that needed updating.
      
      res_pjsip_dtmf_info.c: When handling incoming INFO requests, we need to
      return early if there is no channel on the session.
      
      res_pjsip_session.c: When handling a 302 response, we need to stop the
      redirecting attempt if there is no channel on the session.
      
      ASTERISK-25148 #close
      reported by Mark Michelson
      
      Change-Id: Id1a75ffc3d0eaa168b0b28188fb54d6cf9fc47a9
      92ccffd9
    • George Joseph's avatar
      res_pjsip/location: Fix ref leak in contact_apply_handler · d355ee7f
      George Joseph authored
      contact_apply_handler calls ast_res_pjsip_find_or_create_contact_status
      to force the creation of a contact_status object whenever a new
      contact is added but it didn't unref the returned object.
      
      Added an ao2_cleanup(status) to plug the leak.
      
      ASTERISK-25141
      
      Change-Id: Icc1401cae142855a1abc86ab5179dfb3ee861c40
      Reported-by: Corey Farrell
      d355ee7f
  7. Jun 02, 2015
  8. Jun 01, 2015
  9. May 31, 2015
    • Ivan Poddubny's avatar
      Fix buffer overflow in slin sample frames generation. · 0a5f8c0d
      Ivan Poddubny authored
      The length of frames retured by sample functions was twice as large as
      real, what caused global buffer overflow caught by AddressSanitizer.
      
      ASTERISK-24717 #close
      Reported by: Badalian Vyacheslav
      
      Change-Id: Iec2fe682aef13e556684912f906bedf7c18229c6
      0a5f8c0d
  10. May 29, 2015
  11. May 27, 2015
    • George Joseph's avatar
      endpoint/stasis: Eliminate duplicate events on endpoint status change · 6fca75bb
      George Joseph authored
      
      When an endpoint was created, it's messages were being forwarded to
      both the tech endpoint topic and the all endpoints topic.  Since
      the tech topic was also forwarded to all, this was resulting in
      duplicate messages whenever an endpoint published.  This patch
      causes the endpoint to only forward to the tech topic and lets
      the tech topic forward to all.
      
      To accomplish this, the existing stasis_cp_single_create function
      (which both creates and forwards) was cloned and split into 2
      functions, one that creates the topic and one that sets up the
      forwarding.  This allows endpoint_internal_create to create
      the topic from the endpoint_all cache without forwarding it there,
      then allows it to do the forward to the tech's topic.
      
      ASTERISK-25137 #close
      Reported-by: Vitezslav Novy
      ASTERISK-25116 #close
      Reported-by: default avatarGeorge Joseph <george.joseph@fairview5.com>
      Tested-by: default avatarGeorge Joseph <george.joseph@fairview5.com>
      
      Change-Id: I26d7d4926a0861748fd3bdffe316b75b549a801c
      6fca75bb
    • Mark Michelson's avatar
      res_sorcery_memory_cache: Add support for refreshing stale objects. · 2e54e722
      Mark Michelson authored
      This change introduces a check of object_lifetime_stale when retrieving
      cached objects. If the amount of time the object has been in the cache
      exceeds the lifetime, then a task is scheduled to update the cached
      object based on an object retrieved from other sorcery wizards instead.
      
      To prevent the cached object from being retrieved during a refresh,
      thread-local storage is used to mark the thread as being a stale object
      update. This results in the cache returning no object, leading to
      sorcery querying other wizards for the object instead.
      
      A test has been added for stale objects as well. This test ensures that
      stale objects are retrieved the same as freshly-cached objects. The test
      also ensures that after an object is stale, changes in the backend are
      reflected in the cache, to include if the object has been deleted from
      the backend.
      
      ASTERISK-25067
      Reported by Matt Jordan
      
      Change-Id: I9bd7c049adf6939bfe2899f393c2bfbbf412d217
      2e54e722
  12. May 26, 2015
Loading