From 3df63052544981f769bae7457df6a85e1020ca8c Mon Sep 17 00:00:00 2001 From: Slawomir Jankowski Date: Wed, 20 Jan 2021 14:14:29 +0100 Subject: [PATCH] Change strnlen to sizeof in set_device_path() Signed-off-by: Slawomir Jankowski --- casadm/cas_lib.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/casadm/cas_lib.c b/casadm/cas_lib.c index 03bb047..5e1d894 100644 --- a/casadm/cas_lib.c +++ b/casadm/cas_lib.c @@ -653,8 +653,7 @@ int set_device_path(char *dest_path, size_t dest_len, const char *src_path, size /* check if given dev_path is whitelisted and then pass it as path or not */ if (is_dev_link_whitelisted(abs_dev_path)){ - result = strncpy_s(dest_path, dest_len, abs_dev_path, - strnlen_s(abs_dev_path, sizeof(abs_dev_path))); + result = strncpy_s(dest_path, dest_len, abs_dev_path, sizeof(abs_dev_path)); return result ?: SUCCESS; }