From: "flichtenheld (Code Review)" Date: Tue, 9 Jan 2024 11:09:02 +0000 References: Reply-To: frank@...2641..., arne-openvpn@...1227..., openvpn-devel@lists.sourceforge.net Message-ID: <77b603bc7e5a745a4e88f37c194cb081860c9c61-HTML@...2715...> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline Content-Type: multipart/alternative; boundary="tXmJurzQCuE="; charset=UTF-8 Subject: [Openvpn-devel] [XS] Change in openvpn[master]: buf_string_match_head_str: Fix Coverity issue "Unsigned compared agai... List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: plaisthos Cc: openvpn-devel --tXmJurzQCuE= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Attention is currently required from: plaisthos. Hello plaisthos, I'd like you to do a code review. Please visit http://gerrit.openvpn.net/c/openvpn/+/491?usp=3Demail to review the following change. Change subject: buf_string_match_head_str: Fix Coverity issue "Unsigned com= pared against 0" ...................................................................... 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 7fc608da4ec388c9209bd009cd5053ac0ff7df38 which triggered warning, but the check did not make sense before, either. Change-Id: I64f094eeb0ca8c3953a94d742adf468faf27dab3 Signed-off-by: Frank Lichtenheld --- M src/openvpn/buffer.c 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/91/491/1 diff --git a/src/openvpn/buffer.c b/src/openvpn/buffer.c index 0b94a52..2ad3461 100644 --- a/src/openvpn/buffer.c +++ b/src/openvpn/buffer.c @@ -822,7 +822,7 @@ buf_string_match_head_str(const struct buffer *src, const char *match) { const size_t size =3D strlen(match); - if (size < 0 || size > src->len) + if (size > src->len) { return false; } -- To view, visit http://gerrit.openvpn.net/c/openvpn/+/491?usp=3Demail To unsubscribe, or for help writing mail filters, visit http://gerrit.openv= pn.net/settings Gerrit-Project: openvpn Gerrit-Branch: master Gerrit-Change-Id: I64f094eeb0ca8c3953a94d742adf468faf27dab3 Gerrit-Change-Number: 491 Gerrit-PatchSet: 1 Gerrit-Owner: flichtenheld Gerrit-Reviewer: plaisthos Gerrit-CC: openvpn-devel Gerrit-Attention: plaisthos Gerrit-MessageType: newchange --tXmJurzQCuE= Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

Attention is currently required from: plaisthos.

flichtenheld would like plaisthos to review this change.

Vi= ew Change

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
7fc608da4ec388c9209bd009cd505= 3ac0ff7df38 which triggered warning,
but the check did not make sense be= fore, either.

Change-Id: I64f094eeb0ca8c3953a94d742adf468faf27dab3Signed-off-by: Frank Lichtenheld <frank@...2641...>
---
M src= /openvpn/buffer.c
1 file changed, 1 insertion(+), 1 deletion(-)

<= /pre>
<=
span>diff --git a/src/openvpn/buffer.c b/src/openvpn/buffer.c
index 0b94a52..2ad3461 100644
--- a/src/openvpn/buffer.c=
+++ b/src/openvpn/buffer.c
@@ -822,7 +822,= 7 @@
buf_string_match_head_str(const struct buffer *src, c= onst char *match)
{
const size_t size= =3D strlen(match);
- = if (size < 0 || size > src->len)
+ if (size > src->len)
= {
return false;
}
=

To view, visit change 491. To unsubscribe, or for help= writing mail filters, visit settings.

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I64f094eeb0ca8c3953a94d742ad= f468faf27dab3
Gerrit-Change-Number: 491
Gerrit-PatchSet: 1
Gerrit-Owner: flichtenheld <frank@...2723...= .>
Gerrit-Reviewer: plaisthos <arne-openvpn@...1186...= .1227...>
Gerrit-CC: openvpn-devel <openvpn-devel@...1484...= ts.sourceforge.net>
Gerrit-Attention: plaisthos <arne-openvpn@...220...= ..1227...>
Gerrit-MessageType: newchange
--tXmJurzQCuE=--