mirror of
https://github.com/OpenVPN/openvpn.git
synced 2024-09-20 03:52:28 +02:00
buf_string_match_head_str: Fix Coverity issue 'Unsigned compared against 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
7fc608da4e
which triggered warning,
but the check did not make sense before, either.
Change-Id: I64f094eeb0ca8c3953a94d742adf468faf27dab3
Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com>
Acked-by: Arne Schwabe <arne-openvpn@rfc2549.org>
Message-Id: <20240119120341.22933-1-gert@greenie.muc.de>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg28093.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
This commit is contained in:
parent
b541a86948
commit
bc29bd6a33
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user