Added check for zero length buffer size in primitive decoders that returns zero to enable simpler complex value optional element decoding. (#876)

This commit is contained in:
Steve Karg
2024-12-18 15:29:27 -06:00
committed by GitHub
parent 389b6a7d4d
commit 6b6be4a434
11 changed files with 723 additions and 270 deletions
+2 -2
View File
@@ -106,14 +106,14 @@ static void testBACnetDestination(void)
zassert_equal(apdu_len, null_len, NULL);
test_len = bacnet_destination_decode(apdu, apdu_len, &test_destination);
zassert_equal(test_len, apdu_len, NULL);
test_len = bacnet_destination_decode(apdu, apdu_len, NULL);
zassert_equal(test_len, apdu_len, NULL);
/* decoding, some negative tests */
test_len = bacnet_destination_decode(NULL, apdu_len, &test_destination);
zassert_equal(test_len, BACNET_STATUS_REJECT, NULL);
test_len = bacnet_destination_decode(apdu, 0, &test_destination);
zassert_equal(test_len, BACNET_STATUS_REJECT, NULL);
test_len = bacnet_destination_decode(apdu, apdu_len, NULL);
zassert_equal(test_len, BACNET_STATUS_REJECT, NULL);
}
/**
* @}