From: "flichtenheld (Code Review)" Date: Sun, 5 Apr 2026 22:03:33 +0000 References: Reply-To: frank@...2641..., arne-openvpn@...1227..., openvpn-devel@lists.sourceforge.net Message-ID: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline Content-Type: multipart/alternative; boundary="9Q4R1A1SVL0="; charset=UTF-8 Subject: [Openvpn-devel] [XS] Change in openvpn[master]: test_packet_id: Add a check after malloc to ensure value is valid List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: plaisthos Cc: openvpn-devel --9Q4R1A1SVL0= 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/+/1621?usp=3Demail to review the following change. Change subject: test_packet_id: Add a check after malloc to ensure value is= valid ...................................................................... test_packet_id: Add a check after malloc to ensure value is valid cppcheck complains about a potential null pointer dereference in reliable_get_num_output_sequenced_available. That is mostly theoretical, but still add a check. Change-Id: I64da2328591ef2b9ee7502e574c878651cdf356a Signed-off-by: Frank Lichtenheld --- M tests/unit_tests/openvpn/test_packet_id.c 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/21/1621/1 diff --git a/tests/unit_tests/openvpn/test_packet_id.c b/tests/unit_tests/o= penvpn/test_packet_id.c index b7538bd..5dfd319 100644 --- a/tests/unit_tests/openvpn/test_packet_id.c +++ b/tests/unit_tests/openvpn/test_packet_id.c @@ -164,6 +164,7 @@ test_get_num_output_sequenced_available(void **state) { struct reliable *rel =3D malloc(sizeof(struct reliable)); + assert_non_null(rel); reliable_init(rel, 100, 50, 8, false); rel->array[5].active =3D true; -- To view, visit http://gerrit.openvpn.net/c/openvpn/+/1621?usp=3Demail To unsubscribe, or for help writing mail filters, visit http://gerrit.openv= pn.net/settings?usp=3Demail Gerrit-MessageType: newchange Gerrit-Project: openvpn Gerrit-Branch: master Gerrit-Change-Id: I64da2328591ef2b9ee7502e574c878651cdf356a Gerrit-Change-Number: 1621 Gerrit-PatchSet: 1 Gerrit-Owner: flichtenheld Gerrit-Reviewer: plaisthos Gerrit-CC: openvpn-devel Gerrit-Attention: plaisthos --9Q4R1A1SVL0= Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

Attention is cur= rently required from: plaisthos.

flichtenheld would like plaisthos to review this change.

V= iew Change

test_packet_id: Add a check after malloc to=
 ensure value is valid

cppcheck complains about a potential null poi= nter dereference
in reliable_get_num_output_sequenced_available. That is= mostly
theoretical, but still add a check.

Change-Id: I64da23285= 91ef2b9ee7502e574c878651cdf356a
Signed-off-by: Frank Lichtenheld <fra= nk@...2641...>
---
M tests/unit_tests/openvpn/test_packet_id.c
= 1 file changed, 1 insertion(+), 0 deletions(-)

g=
it pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/21/1621/1
=
diff --git a/tests/unit_tests/openvpn/test_packet_id.c b/tests/unit_test=
s/openvpn/test_packet_id.c
index b7538bd..5dfd319 100644
--- a/tests/unit_tests/openvpn/test_packet_id.c
+++ b/tests/unit_tests/openvpn/test_packet_id.c

@@ -164,= 6 +164,7 @@
test_get_num_output_sequenced_available(void *= *state)
{
struct reliable *rel =3D ma= lloc(sizeof(struct reliable));
+ assert_non_null(rel);
reliable_init(rel= , 100, 50, 8, false);

rel->array[= 5].active =3D true;

To view, visit change 1621<= /a>. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: newchange
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I64da2328591ef2b9ee7502e574c= 878651cdf356a
Gerrit-Change-Number: 1621
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...>
= --9Q4R1A1SVL0=--