Change strnlen to sizeof in set_device_path()

Signed-off-by: Slawomir Jankowski <slawomir.jankowski@intel.com>
This commit is contained in:
Slawomir Jankowski 2021-01-20 14:14:29 +01:00
parent 59558a8ac6
commit 3df6305254

View File

@ -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 */ /* check if given dev_path is whitelisted and then pass it as path or not */
if (is_dev_link_whitelisted(abs_dev_path)){ if (is_dev_link_whitelisted(abs_dev_path)){
result = strncpy_s(dest_path, dest_len, abs_dev_path, result = strncpy_s(dest_path, dest_len, abs_dev_path, sizeof(abs_dev_path));
strnlen_s(abs_dev_path, sizeof(abs_dev_path)));
return result ?: SUCCESS; return result ?: SUCCESS;
} }