[asterisk-dev] [Code Review] 3677: REF_DEBUG: record an entry to refs log when we run ao2_ref against an invalid (likely already freed) ao2 pointer

Corey Farrell reviewboard at asterisk.org
Wed Jun 25 22:21:28 CDT 2014


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviewboard.asterisk.org/r/3677/
-----------------------------------------------------------

Review request for Asterisk Developers, Matt Jordan and rmudgett.


Bugs: ASTERISK-23948
    https://issues.asterisk.org/jira/browse/ASTERISK-23948


Repository: Asterisk


Description
-------

__ao2_ref_debug exits early when INTERNAL_OBJ returns NULL.  When user_data != NULL and delta != 0 we should always write to ref_log.  This change reorders __ao2_ref_debug to delay the return for obj == NULL.  Code that writes to ref_log is modified to be safe with obj == NULL.

This code is slightly different in 11 (funcname parameter is named func).  In 12+ a backtrace and assert were added to the existing obj == NULL block.  Patches for 11 and 12 can be viewed on JIRA.


Diffs
-----

  /branches/1.8/main/astobj2.c 417247 

Diff: https://reviewboard.asterisk.org/r/3677/diff/


Testing
-------


Thanks,

Corey Farrell

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20140626/5d95f7cd/attachment.html>


More information about the asterisk-dev mailing list