From 5fb707f9b2eeea9593a493912d5f774434b0d968 Mon Sep 17 00:00:00 2001
From: sverma <saurabh.verma@iopsys.eu>
Date: Tue, 26 Apr 2022 15:04:30 +0530
Subject: [PATCH] fixed cmdu_parse_single_tlv for strict length checking

---
 src/cmdu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/cmdu.c b/src/cmdu.c
index 207f9467..2fa48ea0 100644
--- a/src/cmdu.c
+++ b/src/cmdu.c
@@ -588,7 +588,7 @@ int cmdu_parse_tlv_single(struct cmdu_buff *c, struct tlv *tv[],
 		if (policy->type != t->type)
 			continue;
 
-		if (policy[i].len && tlv_length(t) != policy[i].len)
+		if (policy->len && tlv_length(t) != policy->len)
 			return -1;
 
 		if (policy->minlen > 0 && tlv_length(t) < policy->minlen)
-- 
GitLab