diff options
author | speidy <speidy@gmail.com> | 2017-03-07 08:15:50 +0200 |
---|---|---|
committer | Idan Freiberg <speidy@gmail.com> | 2017-03-16 00:20:10 +0200 |
commit | cfdbc2b4dbe4621237aaab1c8ea42a8d43fb9781 (patch) | |
tree | 0a66f40d4886b70ee90ed3c0d8e502cdeb03649c | |
parent | 6ed4c969f4d646a7751fe2da29ba94eddd3d6477 (diff) | |
download | xrdp-proprietary-cfdbc2b4dbe4621237aaab1c8ea42a8d43fb9781.tar.gz xrdp-proprietary-cfdbc2b4dbe4621237aaab1c8ea42a8d43fb9781.zip |
chansrv: dvc, check channel exists on get/remove api struct
-rw-r--r-- | sesman/chansrv/chansrv.c | 6 |
1 files 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; |