summaryrefslogtreecommitdiff
path: root/channels/chan_skinny.c
diff options
context:
space:
mode:
authorRichard Mudgett <rmudgett@digium.com>2015-11-24 12:44:53 -0600
committerRichard Mudgett <rmudgett@digium.com>2015-12-01 13:54:04 -0600
commitfa2072903238ddb8dbba7d75ccf70edb36581f36 (patch)
treecbf6fd65a2b2cd3bd9ba5f78ad7f71ba3f1547eb /channels/chan_skinny.c
parente5723d27763b85b66972a275cd90f4a592bcc21f (diff)
Audit improper usage of scheduler exposed by 5c713fdf18f.
channels/chan_iax2.c: * Initialize struct chan_iax2_pvt scheduler ids earlier because of iax2_destroy_helper(). channels/chan_sip.c: channels/sip/config_parser.c: * Fix initialization of scheduler id struct members. Some off nominal paths had 0 as a scheduler id to be destroyed when it was never started. chan_skinny.c: * Fix some scheduler id comparisons that excluded the valid 0 id. channel.c: * Fix channel initialization of the video stream scheduler id. pbx_dundi.c: * Fix channel initialization of the packet retransmission scheduler id. ASTERISK-25476 Change-Id: I07a3449f728f671d326a22fcbd071f150ba2e8c8
Diffstat (limited to 'channels/chan_skinny.c')
-rw-r--r--channels/chan_skinny.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/channels/chan_skinny.c b/channels/chan_skinny.c
index 6f56f732e..707ab02c5 100644
--- a/channels/chan_skinny.c
+++ b/channels/chan_skinny.c
@@ -5548,12 +5548,12 @@ static void setsubstate(struct skinny_subchannel *sub, int state)
skinny_locksub(sub);
- if (sub->dialer_sched) {
+ if (-1 < sub->dialer_sched) {
skinny_sched_del(sub->dialer_sched, sub);
sub->dialer_sched = -1;
}
- if (state != SUBSTATE_RINGIN && sub->aa_sched) {
+ if (state != SUBSTATE_RINGIN && -1 < sub->aa_sched) {
skinny_sched_del(sub->aa_sched, sub);
sub->aa_sched = -1;
sub->aa_beep = 0;
@@ -6238,7 +6238,7 @@ static int handle_keypad_button_message(struct skinny_req *req, struct skinnyses
}
if ((sub->owner && ast_channel_state(sub->owner) < AST_STATE_UP)) {
- if (sub->dialer_sched && !skinny_sched_del(sub->dialer_sched, sub)) {
+ if (-1 < sub->dialer_sched && !skinny_sched_del(sub->dialer_sched, sub)) {
SKINNY_DEBUG(DEBUG_SUB, 3, "Sub %u - Got a digit and not timed out, so try dialing\n", sub->callid);
sub->dialer_sched = -1;
len = strlen(sub->exten);
@@ -7075,7 +7075,7 @@ static int handle_soft_key_event_message(struct skinny_req *req, struct skinnyse
case SOFTKEY_BKSPC:
SKINNY_DEBUG(DEBUG_PACKET, 3, "Received SOFTKEY_BKSPC from %s, inst %d, callref %d\n",
d->name, instance, callreference);
- if (sub->dialer_sched && !skinny_sched_del(sub->dialer_sched, sub)) {
+ if (-1 < sub->dialer_sched && !skinny_sched_del(sub->dialer_sched, sub)) {
size_t len;
sub->dialer_sched = -1;
len = strlen(sub->exten);