From cf0e257dcf3d23a3b38129e1a3375f1c38c10973 Mon Sep 17 00:00:00 2001 From: Florin Coras Date: Wed, 14 Apr 2021 17:55:02 -0700 Subject: vcl: validate fs before cleanup Type: fix Signed-off-by: Florin Coras Change-Id: I1d3677923ab28325380c4a9e8469da83077262a9 --- src/vcl/vcl_private.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/vcl/vcl_private.c b/src/vcl/vcl_private.c index eb01d1c14b1..ba54c91f5cd 100644 --- a/src/vcl/vcl_private.c +++ b/src/vcl/vcl_private.c @@ -459,8 +459,11 @@ vcl_session_detach_fifos (vcl_session_t *s) fifo_segment_free_client_fifo (fs, s->tx_fifo); if (s->ct_rx_fifo) { - fs = fifo_segment_get_segment (&vcm->segment_main, - s->ct_rx_fifo->segment_index); + fs = fifo_segment_get_segment_if_valid (&vcm->segment_main, + s->ct_rx_fifo->segment_index); + if (!fs) + goto done; + fifo_segment_free_client_fifo (fs, s->ct_rx_fifo); fifo_segment_free_client_fifo (fs, s->ct_tx_fifo); } -- cgit 1.2.3-korg