1. 08 11月, 2015 1 次提交
    • Peter Wu's avatar
      switch_xml_set_attr: fix inconsistent state on error paths · b6831996
      Peter Wu 提交于
      Partially rewrite switch_xml_set_attr to fix memory leaks, uninitialized
      argument values and use-after free warnings from Clang static analyzer.
      
      Fixes these problems:
      
       - Add some comments and a new variable such that the code can more
         easily be audited / understood.
       - Always clear SWITCH_XML_DUP flag even if an error occurred to prevent
         free()'ing static strings on future invocations.
       - Keep the attribute list in a consistent state even if one of the
         memory allocation fails.
       - Keep allocation metadata in a consistent state when shrinking of the
         attribute lists fails. Previously the metadata was not updated,
         resulting in a wrong mapping from attributes to allocation flags.
       - Fix memory leaks when allocations fail.
      
      Previous behavior: invalid memory accesses are possible after a memory
      allocation failure, previous attributes may be lost.
      New behavior: attributes list is always valid, a new attribute is either
      set (or not), attributes can always be removed.
      b6831996
  2. 06 11月, 2015 3 次提交
  3. 05 11月, 2015 4 次提交
  4. 04 11月, 2015 5 次提交
  5. 03 11月, 2015 2 次提交
  6. 29 10月, 2015 10 次提交
  7. 28 10月, 2015 4 次提交
  8. 27 10月, 2015 3 次提交
  9. 26 10月, 2015 3 次提交
  10. 23 10月, 2015 2 次提交
  11. 22 10月, 2015 3 次提交