aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/session/session_node.c
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2023-06-27 19:45:59 -0700
committerFlorin Coras <fcoras@cisco.com>2023-06-27 20:34:21 -0700
commitc8767c42aadb5bd63206e117673991ef799e2d18 (patch)
treebcf39620e408a8580aa11b4b38f80d1fd1aea4db /src/vnet/session/session_node.c
parent31eaea9eef0594117e83733aa01f8bbda940e4da (diff)
session udp: add len check for tx dgrams
Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I35391fb8c39defbe0e57a241a357c3c98e8cef54
Diffstat (limited to 'src/vnet/session/session_node.c')
-rw-r--r--src/vnet/session/session_node.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/vnet/session/session_node.c b/src/vnet/session/session_node.c
index f652f2e9a1c..6d1b6bdf2ae 100644
--- a/src/vnet/session/session_node.c
+++ b/src/vnet/session/session_node.c
@@ -1236,6 +1236,13 @@ session_tx_set_dequeue_params (vlib_main_t * vm, session_tx_context_t * ctx,
ctx->max_len_to_snd = 0;
return;
}
+ /* We cannot be sure apps have not enqueued incomplete dgrams */
+ if (PREDICT_FALSE (ctx->max_dequeue <
+ ctx->hdr.data_length + sizeof (ctx->hdr)))
+ {
+ ctx->max_len_to_snd = 0;
+ return;
+ }
ASSERT (ctx->hdr.data_length > ctx->hdr.data_offset);
len = ctx->hdr.data_length - ctx->hdr.data_offset;