From cfdbc2b4dbe4621237aaab1c8ea42a8d43fb9781 Mon Sep 17 00:00:00 2001 From: speidy Date: Tue, 7 Mar 2017 08:15:50 +0200 Subject: chansrv: dvc, check channel exists on get/remove api struct --- sesman/chansrv/chansrv.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sesman/chansrv/chansrv.c b/sesman/chansrv/chansrv.c index e2fd2db9..5ad4223e 100644 --- a/sesman/chansrv/chansrv.c +++ b/sesman/chansrv/chansrv.c @@ -1670,7 +1670,8 @@ struct_from_dvc_chan_id(tui32 dvc_chan_id) for (i = 0; i < MAX_DVC_CHANNELS; i++) { - if (g_dvc_channels[i]->dvc_chan_id >= 0 && + if (g_dvc_channels[i] != NULL && + g_dvc_channels[i]->dvc_chan_id >= 0 && (tui32) g_dvc_channels[i]->dvc_chan_id == dvc_chan_id) { return g_dvc_channels[i]; @@ -1687,7 +1688,8 @@ remove_struct_with_chan_id(tui32 dvc_chan_id) for (i = 0; i < MAX_DVC_CHANNELS; i++) { - if (g_dvc_channels[i]->dvc_chan_id >= 0 && + if (g_dvc_channels[i] != NULL && + g_dvc_channels[i]->dvc_chan_id >= 0 && (tui32) g_dvc_channels[i]->dvc_chan_id == dvc_chan_id) { g_dvc_channels[i] = NULL; -- cgit v1.2.1