summaryrefslogtreecommitdiffstats
path: root/src/plugins/hs_apps
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2020-09-29 07:45:25 -0700
committerDave Barach <openvpp@barachs.net>2020-09-29 17:36:59 +0000
commite7f70d90fe9c34fe61674200a8c4621a81aebd36 (patch)
treea24a91c55fa6bb952913723d57112fa9b41ded31 /src/plugins/hs_apps
parent346ec9ac385b4e486605ed572a21ea80fd15ad66 (diff)
hsa: fix coverity warning
Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I046e5aa90016e45b5cbaec12593ba4ac7a659783
Diffstat (limited to 'src/plugins/hs_apps')
-rw-r--r--src/plugins/hs_apps/vcl/vcl_test_server.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/plugins/hs_apps/vcl/vcl_test_server.c b/src/plugins/hs_apps/vcl/vcl_test_server.c
index d55fef30e89..852c96863ce 100644
--- a/src/plugins/hs_apps/vcl/vcl_test_server.c
+++ b/src/plugins/hs_apps/vcl/vcl_test_server.c
@@ -255,12 +255,13 @@ vts_server_rx (vcl_test_server_conn_t * conn, int rx_bytes)
static void
vts_copy_ds (void *buf, vppcom_data_segment_t * ds, u32 max_bytes)
{
- uint32_t n_bytes = 0, ds_idx = 0;
+ uint32_t n_bytes = 0, ds_idx = 0, to_copy;
while (n_bytes < max_bytes)
{
- clib_memcpy_fast (buf + n_bytes, ds[ds_idx].data,
- clib_min (ds[ds_idx].len, max_bytes - n_bytes));
+ to_copy = clib_min (ds[ds_idx].len, max_bytes - n_bytes);
+ clib_memcpy_fast (buf + n_bytes, ds[ds_idx].data, to_copy);
+ n_bytes += to_copy;
ds_idx += 1;
}
}