Summary: | ASTERISK-10217: iax2 craches on an empty host= line | ||
Reporter: | Niklas Larsson (pnlarsson) | Labels: | |
Date Opened: | 2007-09-01 15:49:04 | Date Closed: | 2007-09-03 13:40:47 |
Priority: | Critical | Regression? | No |
Status: | Closed/Complete | Components: | Channels/chan_iax2 |
Versions: | Frequency of Occurrence | ||
Related Issues: | |||
Environment: | Attachments: | ( 0) bt.txt.txt ( 1) iax2.diff.txt | |
Description: | This happens in the 1.4 (rev 81429) branch and asterisk is not craching on 1.4.11. Just have an entry in iax.conf with an empty host= line and chan_iax is toast. [8541] username=8541 type=friend secret=xxxxxxxxx insecure=very host= context=from-xxxxxxx ****** ADDITIONAL INFORMATION ****** Debian etch, latest 1.4 branch. | ||
Comments: | By: Niklas Larsson (pnlarsson) 2007-09-01 17:14:51 Well this seams to be a result of r80362 - Merge changes from team/russell/iax_refcount. Before r80362 the peer 8541 (with a host= ) would not show up on iax2 show peers... By: Niklas Larsson (pnlarsson) 2007-09-01 17:45:17 Found something that made it work again, not shure this is the fix but... Removed the call to ast_string_field_free_pools(peer); since it's already called in peer_destructor. See the one line diff. By: Niklas Larsson (pnlarsson) 2007-09-01 17:52:41 There are at least one more place (line 9038) where ast_string_field_free_pools is called before peer_unref. Have not added that to the diff. By: James Golovich (jamesgolovich) 2007-09-03 02:02:37 Haven't tested but I suspect this could easily be fixed by doing: } else if (!strcasecmp(v->name, "host") && !ast_strlen_zero(v->value)) { which will just be like there was no host= line specified. It won't likely be a functional peer at all but it shouldnt crash By: Digium Subversion (svnbot) 2007-09-03 13:39:32 Repository: asterisk Revision: 81433 ------------------------------------------------------------------------ r81433 | russell | 2007-09-03 13:39:32 -0500 (Mon, 03 Sep 2007) | 5 lines Remove a couple of calls to ast_string_field_free_pools() on peers in error handling blocks in the code for building peers. The peer object destructor does this and doing it twice will cause a crash. (closes issue ASTERISK-10217, reported by and patched by pnlarsson) ------------------------------------------------------------------------ By: Digium Subversion (svnbot) 2007-09-03 13:40:47 Repository: asterisk Revision: 81434 ------------------------------------------------------------------------ r81434 | russell | 2007-09-03 13:40:47 -0500 (Mon, 03 Sep 2007) | 13 lines Merged revisions 81433 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r81433 | russell | 2007-09-03 13:57:53 -0500 (Mon, 03 Sep 2007) | 5 lines Remove a couple of calls to ast_string_field_free_pools() on peers in error handling blocks in the code for building peers. The peer object destructor does this and doing it twice will cause a crash. (closes issue ASTERISK-10217, reported by and patched by pnlarsson) ........ ------------------------------------------------------------------------ |