mirror of
https://github.com/OpenVPN/openvpn.git
synced 2026-04-23 23:27:06 -04:00
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 <frank@lichtenheld.com> Acked-by: Gert Doering <gert@greenie.muc.de> Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1621 Message-Id: <20260406074729.29903-1-gert@greenie.muc.de> URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg36516.html Signed-off-by: Gert Doering <gert@greenie.muc.de>
This commit is contained in:
parent
08a19843a1
commit
cdb0fbde26
1 changed files with 1 additions and 0 deletions
|
|
@ -164,6 +164,7 @@ static void
|
|||
test_get_num_output_sequenced_available(void **state)
|
||||
{
|
||||
struct reliable *rel = malloc(sizeof(struct reliable));
|
||||
assert_non_null(rel);
|
||||
reliable_init(rel, 100, 50, 8, false);
|
||||
|
||||
rel->array[5].active = true;
|
||||
|
|
|
|||
Loading…
Reference in a new issue