Mark Michelson
f436b9ab11
res_pjsip_registrar: Fix bad memory-ness with user_agent.
...
Recent changes to the PJSIP registrar resulted in tests failing due to
missing AOR_CONTACT_ADDED test events. The reason for this was that the
user_agent string had junk values in it, resulting in being unable to
generate the event.
I'm going to be honest here, I have no idea why this was happening. Here
are the steps needed for the user_agent variable to get messed up:
* REGISTER is received
* First contact in the REGISTER results in a contact being removed
* Second contact in the REGISTER results in a contact being added
* The contact, AOR, expiration, and user agent all have to be passed as
format parameters to the creation of a string. Any subset of those
parameters would not be enough to cause the problem.
Looking into what was happening, the thing that struck me as odd was
that the user_agent variable was meant to be set to the value of the
User-Agent SIP header in the incoming REGISTER. However, when removing a
contact, the user_agent variable would be set (via ast_strdupa inside a
loop) to the stored contact's user_agent. This means that the
user_agent's value would be incorrect when attempting to process further
contacts in the incoming REGISTER.
The fix here is to use a different variable for the stored user agent
when removing a contact. Correcting the behavior to be correct also
means the memory usage is less weird, and the issue no longer occurs.
ASTERISK-25929 #close
Reported by Joshua Colp
Change-Id: I7cd24c86a38dec69ebcc94150614bc25f46b8c08
2016-04-19 08:23:54 -05:00
..
2015-04-12 13:48:10 -05:00
2016-03-31 13:39:03 -05:00
2016-03-29 08:53:45 -05:00
2016-04-14 07:15:47 -05:00
2015-01-20 16:46:16 +00:00
2016-03-30 16:23:40 -05:00
2015-04-07 02:03:20 +00:00
2015-04-29 07:39:22 -04:00
2016-02-01 13:19:41 -06:00
2014-07-25 16:47:17 +00:00
2014-07-25 16:47:17 +00:00
2015-11-25 15:33:29 -06:00
2015-04-29 07:39:22 -04:00
2015-08-07 14:55:53 -05:00
2015-04-29 07:39:22 -04:00
2015-04-29 07:39:22 -04:00
2015-04-29 07:39:22 -04:00
2015-04-29 07:39:22 -04:00
2015-09-22 13:27:14 -05:00
2015-04-29 07:39:22 -04:00
2014-07-25 16:47:17 +00:00
2013-07-27 23:11:02 +00:00
2015-04-29 07:39:22 -04:00
2015-04-29 07:39:22 -04:00
2015-04-29 07:39:22 -04:00
2015-08-18 16:49:25 -05:00
2013-07-27 23:11:02 +00:00
2014-07-25 16:47:17 +00:00
2014-10-12 07:44:32 +00:00
2014-07-25 16:47:17 +00:00
2014-07-25 16:47:17 +00:00
2016-01-10 13:32:48 -06:00
2015-12-09 15:57:35 -06:00
2014-07-25 16:47:17 +00:00
2014-07-20 22:06:33 +00:00
2014-07-25 16:47:17 +00:00
2014-07-25 16:47:17 +00:00
2015-03-10 21:33:40 +00:00
2015-10-14 14:18:45 -05:00
2016-02-23 16:01:52 -06:00
2015-09-18 13:52:46 -05:00
2011-07-14 20:28:54 +00:00
2015-06-26 22:02:42 -05:00
2016-01-09 13:39:00 -06:00
2010-07-21 19:11:32 +00:00
2014-07-25 16:47:17 +00:00
2015-11-24 13:54:54 -06:00
2015-04-29 15:37:12 -05:00
2015-12-16 17:17:30 -04:00
2014-07-18 15:49:46 +00:00
2014-07-25 16:47:17 +00:00
2014-07-25 16:47:17 +00:00
2015-11-19 08:15:30 +01:00
2015-12-04 07:21:06 -06:00
2015-08-09 18:42:00 -05:00
2015-12-04 08:57:50 -06:00
2014-10-16 14:35:00 +00:00
2015-05-22 22:58:32 -04:00
2014-11-06 09:23:32 +00:00
2014-03-28 18:32:50 +00:00
2014-07-25 16:47:17 +00:00
2016-04-05 12:21:32 -03:00
2014-06-26 18:27:53 +00:00
2012-10-14 21:44:27 +00:00
2015-01-09 17:54:49 +00:00
2015-01-09 17:54:49 +00:00
2015-04-13 07:27:40 -04:00
2016-03-24 13:45:06 +01:00
2014-03-27 19:21:44 +00:00
2015-05-21 18:18:16 -05:00
2016-01-04 16:28:48 -07:00
2014-01-06 17:45:25 +00:00
2016-01-29 08:32:35 -06:00
2016-01-29 08:32:35 -06:00
2016-02-03 13:07:07 -07:00
2016-02-16 15:37:48 -07:00
2016-03-29 08:53:45 -05:00
2016-02-11 19:59:02 +00:00
2014-10-09 17:45:23 +00:00
2016-02-18 16:30:18 -06:00
2016-01-20 06:13:41 -07:00
2015-03-17 21:49:30 +00:00
2014-10-16 14:35:00 +00:00
2016-03-03 19:32:33 -07:00
2016-02-15 21:36:57 -06:00
2016-04-08 05:48:51 -05:00
2016-03-01 20:13:39 -06:00
2015-05-02 03:15:15 -04:00
2016-03-03 12:42:57 -04:00
2016-02-08 18:08:32 -07:00
2016-03-07 12:15:58 -07:00
2016-02-08 18:08:32 -07:00
2015-10-22 15:07:41 -05:00
2013-07-30 18:14:50 +00:00
2014-10-16 14:35:00 +00:00
2015-12-26 11:50:03 -06:00
2014-10-16 14:35:00 +00:00
2016-03-02 18:12:00 -06:00
2016-02-08 18:08:32 -07:00
2016-03-30 12:17:29 -06:00
2016-04-04 17:04:15 -06:00
2016-02-08 18:08:32 -07:00
2016-03-07 12:15:58 -07:00
2014-10-16 14:35:00 +00:00
2015-04-30 14:13:42 -05:00
2016-04-08 13:44:53 -05:00
2014-08-07 14:35:09 +00:00
2016-04-14 07:15:47 -05:00
2016-03-07 12:15:58 -07:00
2015-04-09 22:35:11 +00:00
2015-07-06 15:38:15 -05:00
2015-08-06 07:03:28 -03:00
2014-10-16 14:35:00 +00:00
2015-02-20 17:46:17 +00:00
2016-03-30 12:17:29 -06:00
2016-03-30 12:17:29 -06:00
2016-03-17 13:12:29 -05:00
2016-04-11 13:00:14 -05:00
2016-04-19 08:23:54 -05:00
2015-11-13 15:31:02 -06:00
2016-02-08 18:08:32 -07:00
2016-03-03 05:32:51 -06:00
2016-04-05 16:12:47 -05:00
2015-03-10 16:04:32 +00:00
2015-01-29 20:58:12 +00:00
2016-02-29 12:50:19 -06:00
2016-04-14 14:25:13 -05:00
2016-02-08 18:08:32 -07:00
2015-07-06 15:38:15 -05:00
2016-04-11 22:24:50 -05:00
2013-11-23 17:26:57 +00:00
2014-12-17 09:54:00 +00:00
2011-11-01 19:53:26 +00:00
2016-04-05 05:37:09 -05:00
2014-07-25 16:47:17 +00:00
2015-05-22 22:58:32 -04:00
2015-04-08 11:44:32 +00:00
2014-07-25 16:47:17 +00:00
2016-03-25 19:19:39 -06:00
2016-03-25 19:19:39 -06:00
2016-03-25 19:19:39 -06:00
2016-03-25 19:19:39 -06:00
2016-03-25 19:19:39 -06:00
2014-07-25 16:47:17 +00:00
2013-09-16 18:00:32 +00:00
2014-10-27 01:47:26 +00:00
2015-04-07 19:38:27 +00:00
2014-08-22 16:44:21 +00:00
2013-05-20 14:21:39 +00:00
2016-02-04 11:39:10 -06:00
2013-11-23 17:48:28 +00:00
2014-07-25 16:47:17 +00:00
2014-01-14 23:44:57 +00:00
2016-03-30 16:23:40 -05:00
2013-05-23 20:11:35 +00:00
2016-03-31 13:39:03 -05:00
2013-07-03 17:58:45 +00:00
2015-05-06 16:09:33 -05:00
2013-11-23 12:40:46 +00:00
2014-08-06 12:55:28 +00:00
2013-05-08 13:39:08 +00:00
2016-03-31 13:39:03 -05:00
2013-04-15 16:43:47 +00:00
2015-11-18 16:48:13 -06:00
2016-02-16 11:20:57 -07:00
2014-08-06 12:55:28 +00:00
2014-07-25 16:47:17 +00:00
2015-07-02 12:10:22 +02:00
2015-02-15 12:39:09 +00:00
2015-07-02 12:10:22 +02:00
2016-02-02 06:48:01 -06:00
2012-07-07 17:06:51 +00:00