diff --git a/src/cmdu.c b/src/cmdu.c
index 207f9467a32c22e7fa05e6113116a6c0061f3e3f..2fa48ea0da9c451ee042a9eabb0ad79f0568698e 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)