Skip to content

Commit

Permalink
common: Remove overly cautious strnlen
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
sidcha committed May 9, 2024
1 parent c31fb55 commit 1ae7f6a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/osdp_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 1ae7f6a

Please sign in to comment.