From dbd62fc44d401d2281dfca8ff97f64b62845ba43 Mon Sep 17 00:00:00 2001 From: harryhrp Date: Tue, 11 Feb 2025 16:08:54 +0800 Subject: [PATCH] Fix codecheck Fix codecheck Issue: https://gitee.com/openharmony/third_party_selinux/issues/IBLK20 Signed-off-by: harryhrp --- libselinux/src/selinux_restorecon.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libselinux/src/selinux_restorecon.c b/libselinux/src/selinux_restorecon.c index 244d17bd..e432aec3 100644 --- a/libselinux/src/selinux_restorecon.c +++ b/libselinux/src/selinux_restorecon.c @@ -657,7 +657,8 @@ static bool is_hnp_path(const char *path) return true; } -static bool is_all_digits(const char *str, size_t len) { +static bool is_all_digits(const char *str, size_t len) +{ for (size_t i = 0; i < len; i++) { if (!isdigit(str[i])) { return false; @@ -669,7 +670,7 @@ static bool is_all_digits(const char *str, size_t len) { static bool is_aot_path(const char *path) { // only /data/app/el1/{userid}/aot_compiler or /data/app/el1/public/aot_compiler will be true - // length is the length of '/data/app/el1/' + 'aot_compiler' +'{userid}/', The minimum length of the userid is 1 + // The minimum length is /data/app/el1/{userid}/aot_compiler, 2 is the length of '{userid}/' if (strlen(path) < DATA_APP_EL1_LEN + 2 + AOT_ARK_SUFIXX_LEN) { return false; } -- Gitee