Skip to content

Commit

Permalink
buf_string_match_head_str: Fix Coverity issue 'Unsigned compared agai…
Browse files Browse the repository at this point in the history
…nst 0'

As Coverity says:
An unsigned value can never be negative, so this test will always
evaluate the same way.

Was changed from int to size_t in commit
7fc608d which triggered warning,
but the check did not make sense before, either.

Change-Id: I64f094eeb0ca8c3953a94d742adf468faf27dab3
Signed-off-by: Frank Lichtenheld <[email protected]>
Acked-by: Arne Schwabe <[email protected]>
Message-Id: <[email protected]>
URL: https://www.mail-archive.com/[email protected]/msg28093.html
Signed-off-by: Gert Doering <[email protected]>
  • Loading branch information
flichtenheld authored and cron2 committed Jan 19, 2024
1 parent b541a86 commit bc29bd6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/openvpn/buffer.c
Original file line number Diff line number Diff line change
Expand Up @@ -822,7 +822,7 @@ bool
buf_string_match_head_str(const struct buffer *src, const char *match)
{
const size_t size = strlen(match);
if (size < 0 || size > src->len)
if (size > src->len)
{
return false;
}
Expand Down

0 comments on commit bc29bd6

Please sign in to comment.