From feabb77a4823d21bbf1aae48b3c6acfa50689344 Mon Sep 17 00:00:00 2001 From: jiangxiaoming Date: Thu, 21 Nov 2019 23:34:56 +0800 Subject: vcl: if the ldp user send buf with 0 len, it will assert failed. Type: fix Change-Id: I8ff60cf8726c463491c687e170ad0b1026a1303a Signed-off-by: jiangxiaoming (cherry picked from commit ff31ac6809d9913ebd2f58a3a4153a0f419b9a77) --- src/vcl/vppcom.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vcl/vppcom.c b/src/vcl/vppcom.c index 263fa916231..0e5d4fab328 100644 --- a/src/vcl/vppcom.c +++ b/src/vcl/vppcom.c @@ -1897,7 +1897,7 @@ vppcom_session_write_inline (uint32_t session_handle, void *buf, size_t n, svm_msg_q_t *mq; u8 is_ct; - if (PREDICT_FALSE (!buf)) + if (PREDICT_FALSE (!buf || n == 0)) return VPPCOM_EINVAL; s = vcl_session_get_w_handle (wrk, session_handle); -- cgit 1.2.3-korg