Diff between 7c896d7b73cbad2e073fccfb7ddb765f8468602c and 3f1b3c624a9600f73ebb8f31c9533467b8b32584

Changed Files

File Additions Deletions Status
mesh/prov-initiator.c +7 -2 modified

Full Patch

diff --git a/mesh/prov-initiator.c b/mesh/prov-initiator.c
index 653f3ae..e353d23 100644
--- a/mesh/prov-initiator.c
+++ b/mesh/prov-initiator.c
@@ -673,8 +673,13 @@ static void int_prov_rx(void *user_data, const void *dptr, uint16_t len)
 		goto failure;
 	}
 
-	if (type >= L_ARRAY_SIZE(expected_pdu_size) ||
-					len != expected_pdu_size[type]) {
+	if (type >= L_ARRAY_SIZE(expected_pdu_size)) {
+		l_error("Invalid PDU type %2.2x", type);
+		fail_code[1] = PROV_ERR_INVALID_FORMAT;
+		goto failure;
+	}
+
+	if (len != expected_pdu_size[type]) {
 		l_error("Expected PDU size %d, Got %d (type: %2.2x)",
 			expected_pdu_size[type], len, type);
 		fail_code[1] = PROV_ERR_INVALID_FORMAT;