[asterisk-dev] [Code Review] chanspy datastore crash fix in 1.4

David Vossel dvossel at digium.com
Fri Feb 12 11:12:14 CST 2010


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

Review request for Asterisk Developers.


Summary
-------

This is a very simple patch.  I just wanted some eyes on it to verify my logic before I commit it.

In 1.4, chan_spy allocates the data it uses within the chanspy datastore on the stack.  This data may be set and removed on multiple channels throughout its life, but at the end of the chan_spy app all channels holding a reference to this data through a datastore must have that datastore removed, or the channel will crash when it tries to remove the datastore on channel destruction (attempting to access stack space that is no longer valid)

There is been a report that chan_spy datastore removal can cause a crash on channel destruction.  I have come to the conclusion that the addition of a couple of simple checks should verify this will never happen.

1. Since the same stack space is used over and over, whenever the chanspy datastore is setup, verify the previous channel's datastore has been removed.
2. Before data used within the chan_spy datastore is returned on the stack, verify it has been cleaned up properly by calling chanspy_ds_free before destroying the mutex.


This addresses bug 16678.
    https://issues.asterisk.org/view.php?id=16678


Diffs
-----

  /branches/1.4/apps/app_chanspy.c 246419 

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


Testing
-------

tested chanspy in a few situations, verified it still worked at expected.


Thanks,

David




More information about the asterisk-dev mailing list