[asterisk-dev] [Code Review] Fix a crash in res_ais

Russell Bryant reviewboard at asterisk.org
Thu Sep 8 19:31:30 CDT 2011


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

Review request for Asterisk Developers.


Summary
-------

This patch resolves a crash observed in a load testing environment that
involved the use of the res_ais module.  I observed some crashes where
the event delivery callback would get called, but the length parameter
incidcating how much data there was to read was 0.  The code assumed
(with good reason I would think) that if this callback got called, there
was an event available to read.  However, if the rare case that there's
nothing there, catch it and return instead of blowing up.

More specifically, the change always ensure that the size of the received
event in the cluster is always big enough to be a real ast_event.


Diffs
-----

  /branches/1.8/include/asterisk/event.h 335012 
  /branches/1.8/main/event.c 335012 
  /branches/1.8/res/ais/evt.c 335012 

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


Testing
-------

I ran about 120,000 calls through a couple of systems that had this patch.


Thanks,

Russell

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20110909/d7ab9e22/attachment.htm>


More information about the asterisk-dev mailing list