From 1ae7f6a6a29d50c33e8b35ebc542195e16c1dd30 Mon Sep 17 00:00:00 2001 From: Siddharth Chandrasekaran Date: Thu, 9 May 2024 12:12:27 +0530 Subject: [PATCH] common: Remove overly cautious strnlen These strneln causes a warning about accessing OOB when the source string is smaller than the size value of strnelen in some platforms. Since these were an overly cautious proraming practice anyway, we can remove it. Signed-off-by: Siddharth Chandrasekaran --- src/osdp_common.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/osdp_common.c b/src/osdp_common.c index e7a0228..dd64043 100644 --- a/src/osdp_common.c +++ b/src/osdp_common.c @@ -223,9 +223,9 @@ const char *osdp_get_version() OSDP_EXPORT const char *osdp_get_source_info() { - if (strnlen(GIT_TAG, 8) > 0) { + if (strlen(GIT_TAG) > 0) { return GIT_BRANCH " (" GIT_TAG ")"; - } else if (strnlen(GIT_REV, 8) > 0) { + } else if (strlen(GIT_REV) > 0) { return GIT_BRANCH " (" GIT_REV GIT_DIFF ")"; } else { return GIT_BRANCH;