[Home]

Summary:ASTERISK-05086: reg->messages can equal -1 in function iax2_ack_registry
Reporter:Mike Lampard (mlampard)Labels:
Date Opened:2005-09-14 11:19:09Date Closed:2008-01-15 15:48:27.000-0600
Priority:MinorRegression?No
Status:Closed/CompleteComponents:Core/General
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:
Description:Variable reg->messages is tested incorrectly iax_ack_registry (specifically line 5369 of chan_iax2.c).  The value of this variable can be -1, in which case none of the if/else conditions resolve correctly, the msgstatus variable is left uninitialised, and garbage from memory is appended to the informational "Registered IAX2 to...." on registration when verbosity is on.  Simply changing the line from :
else if (reg->messages > -1)
to
else if (reg->messages >= -1)

resolves the problem.
Comments:By: Kevin P. Fleming (kpfleming) 2005-09-14 18:53:34

It seems better to just report 'no messages' whenever the value is less than 1, regardless of what it may be, so I've changed CVS HEAD to do just that. Thanks for the report!

By: Digium Subversion (svnbot) 2008-01-15 15:48:27.000-0600

Repository: asterisk
Revision: 6605

U   trunk/channels/chan_iax2.c

------------------------------------------------------------------------
r6605 | kpfleming | 2008-01-15 15:48:26 -0600 (Tue, 15 Jan 2008) | 2 lines

don't leave a buffer not filled in when getting a REGACK (issue ASTERISK-5086)

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=6605