Audit improper usage of scheduler exposed by 5c713fdf18. (v13 additions)

chan_sip.c:
* Initialize mwi subscription scheduler ids earlier because of ASTOBJ to
ao2 conversion.

* Initialize register scheduler ids earlier because of ASTOBJ to ao2
conversion.

chan_skinny.c:
* Fix more scheduler usage for the valid 0 id value.

ASTERISK-25476

Change-Id: If9f0e5d99638b2f9d102d1ebc9c5a14b2d706e95
This commit is contained in:
Richard Mudgett
2015-11-25 12:23:47 -06:00
parent fa20729032
commit 145d10a5d0
2 changed files with 26 additions and 13 deletions

View File

@@ -9364,6 +9364,9 @@ static int sip_register(const char *value, int lineno)
return -1;
}
reg->expire = -1;
reg->timeout = -1;
if (ast_string_field_init(reg, 256)) {
ao2_t_ref(reg, -1, "failed to string_field_init, drop reg");
return -1;
@@ -9437,6 +9440,8 @@ static int sip_subscribe_mwi(const char *value, int lineno)
return -1;
}
mwi->resub = -1;
if (ast_string_field_init(mwi, 256)) {
ao2_t_ref(mwi, -1, "failed to string_field_init, drop mwi");
return -1;
@@ -9451,7 +9456,6 @@ static int sip_subscribe_mwi(const char *value, int lineno)
}
ast_string_field_set(mwi, hostname, hostname);
ast_string_field_set(mwi, mailbox, mailbox);
mwi->resub = -1;
mwi->portno = portnum;
mwi->transport = transport;