Mark Michelson
b8b60135ec
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:22:23 -05:00
..
2015-05-13 21:55:07 -04:00
2016-04-06 05:43:47 -05:00
2016-03-29 09:03:55 -05:00
2016-04-14 07:23:54 -05:00
2015-05-13 21:55:07 -04:00
2016-04-06 05:43:47 -05:00
2015-04-13 03:48:57 -04:00
2015-04-14 12:53:03 -04:00
2015-04-14 12:53:03 -04:00
2015-05-13 16:34:23 -05:00
2015-05-13 16:34:23 -05:00
2015-11-25 15:26:35 -06:00
2015-05-13 16:34:23 -05:00
2015-08-07 14:57:45 -05:00
2015-05-13 16:34:23 -05:00
2016-04-05 18:14:17 -05:00
2015-05-13 16:34:23 -05:00
2015-05-13 16:34:23 -05:00
2015-09-22 09:59:47 -05:00
2015-05-13 16:34:23 -05:00
2015-05-13 16:34:23 -05:00
2013-07-27 23:11:02 +00:00
2015-05-13 16:34:23 -05:00
2015-05-13 16:34:23 -05:00
2015-05-13 16:34:23 -05:00
2015-08-18 16:38:19 -05:00
2013-07-27 23:11:02 +00:00
2015-05-13 16:34:23 -05:00
2015-04-13 03:48:57 -04:00
2015-05-13 16:34:23 -05:00
2015-05-13 16:34:23 -05:00
2016-01-10 13:32:59 -06:00
2015-12-09 12:48:51 -06:00
2015-05-13 16:34:23 -05:00
2015-05-04 20:47:18 -04:00
2015-05-13 16:34:23 -05:00
2016-03-07 03:42:18 -03:00
2015-05-13 16:34:23 -05:00
2016-03-07 03:42:18 -03:00
2016-02-22 10:11:43 +01:00
2015-09-18 13:49:55 -05:00
2015-05-04 20:47:18 -04:00
2015-06-26 22:06:06 -05:00
2016-01-09 13:39:09 -06:00
2016-03-23 13:53:22 -03:00
2015-11-24 13:57:05 -06:00
2015-05-14 10:57:04 -05:00
2015-12-16 15:21:14 -06:00
2014-07-18 15:49:46 +00:00
2015-04-13 03:48:57 -04:00
2015-04-13 03:48:57 -04:00
2015-11-19 08:09:51 +01:00
2015-12-04 07:20:41 -06:00
2015-08-11 18:24:29 -05:00
2015-12-04 09:01:16 -06:00
2015-05-13 16:34:23 -05:00
2015-05-22 22:30:22 -05:00
2015-05-13 16:34:23 -05:00
2014-03-28 18:32:50 +00:00
2016-03-23 13:53:22 -03:00
2015-04-13 03:48:57 -04:00
2016-04-05 10:22:20 -05:00
2014-06-26 18:27:53 +00:00
2015-04-13 03:48:57 -04:00
2015-05-13 16:34:23 -05:00
2015-05-13 16:34:23 -05:00
2015-05-13 16:34:23 -05:00
2016-03-24 13:51:00 +01:00
2015-04-13 03:48:57 -04:00
2015-05-21 18:18:57 -05:00
2016-01-04 17:31:24 -06:00
2014-01-06 17:45:25 +00:00
2016-03-07 05:02:45 -03:00
2016-01-22 11:59:06 -06:00
2016-02-03 14:11:11 -06:00
2016-02-16 16:42:26 -06:00
2016-03-29 09:03:55 -05:00
2016-02-11 20:19:03 +00:00
2014-10-09 17:46:23 +00:00
2016-02-18 16:30:29 -06:00
2016-01-20 09:56:13 -07:00
2015-05-13 16:34:23 -05:00
2015-05-13 16:34:23 -05:00
2016-03-03 20:35:12 -06:00
2016-02-15 21:37:04 -06:00
2016-04-08 05:49:02 -05:00
2016-03-01 20:21:58 -06:00
2015-05-02 02:22:31 -05:00
2016-03-03 10:43:20 -06:00
2016-02-08 19:11:18 -06:00
2016-03-07 13:16:41 -06:00
2016-02-08 19:11:18 -06:00
2016-04-07 17:20:17 -05:00
2013-07-30 18:14:50 +00:00
2015-05-13 16:34:23 -05:00
2015-12-31 21:27:39 -06:00
2015-05-13 16:34:23 -05:00
2016-03-02 18:02:38 -06:00
2016-02-08 19:11:18 -06:00
2016-03-30 13:23:54 -05:00
2016-04-04 18:05:45 -05:00
2016-02-08 19:11:18 -06:00
2016-03-07 13:16:41 -06:00
2015-05-13 16:34:23 -05:00
2015-05-13 16:34:23 -05:00
2016-04-11 16:05:59 -05:00
2014-08-07 14:35:09 +00:00
2016-04-14 07:23:54 -05:00
2016-03-07 13:16:41 -06:00
2015-05-13 16:34:23 -05:00
2015-07-06 16:15:12 -05:00
2015-08-06 05:20:47 -05:00
2015-05-13 16:34:23 -05:00
2015-05-13 16:34:23 -05:00
2016-03-30 13:23:54 -05:00
2016-03-30 13:23:54 -05:00
2016-03-17 15:11:39 -03:00
2016-04-11 13:00:27 -05:00
2016-04-19 08:22:23 -05:00
2015-11-13 16:34:41 -05:00
2016-02-08 19:11:18 -06:00
2016-03-03 05:32:59 -06:00
2016-04-05 16:13:38 -05:00
2015-03-10 16:08:40 +00:00
2015-05-13 16:34:23 -05:00
2016-02-29 12:50:43 -06:00
2016-04-14 14:28:06 -05:00
2016-02-08 19:11:18 -06:00
2015-07-06 16:15:12 -05:00
2016-04-11 22:26:37 -05:00
2013-11-23 17:26:57 +00:00
2015-05-13 16:34:23 -05:00
2015-04-13 03:48:57 -04:00
2015-06-10 18:06:14 -05:00
2016-04-05 05:37:44 -05:00
2015-08-19 17:09:58 -05:00
2015-05-22 22:30:22 -05:00
2015-05-13 16:34:23 -05:00
2015-05-13 16:34:23 -05:00
2016-03-27 22:43:27 -05:00
2016-03-27 22:43:27 -05:00
2016-03-27 22:43:27 -05:00
2016-03-27 22:43:27 -05:00
2016-03-27 22:43:27 -05:00
2015-05-13 16:34:23 -05:00
2013-09-16 18:00:32 +00:00
2015-04-13 03:48:57 -04:00
2015-03-17 22:03:01 +00:00
2015-05-13 16:34:23 -05:00
2013-05-20 14:21:39 +00:00
2016-02-04 12:05:52 -06:00
2013-11-23 17:48:28 +00:00
2015-05-13 16:34:23 -05:00
2014-01-14 23:44:57 +00:00
2016-03-30 16:36:20 -05:00
2013-05-23 20:11:35 +00:00
2016-03-31 13:20:55 -05:00
2013-07-03 17:58:45 +00:00
2015-05-13 16:34:23 -05:00
2013-11-23 12:40:46 +00:00
2015-05-19 21:11:21 -05:00
2013-05-08 13:39:08 +00:00
2016-04-06 05:43:47 -05:00
2013-04-15 16:43:47 +00:00
2015-11-22 22:38:34 -06:00
2016-02-16 12:26:29 -06:00
2015-05-13 16:34:23 -05:00
2015-05-13 16:34:23 -05:00
2015-07-02 05:13:37 -05:00
2015-05-13 16:34:23 -05:00
2015-07-02 05:13:37 -05:00
2016-02-02 06:48:15 -06:00
2012-07-07 17:06:51 +00:00