Comments and length checks. (#81)

* Comments and length checks.

* Added max_apdu checking.
This commit is contained in:
Roy Schneider
2020-05-02 03:29:21 +02:00
committed by GitHub
parent fdd49f1791
commit 05aaee7f6b
4 changed files with 154 additions and 34 deletions
+7 -5
View File
@@ -674,11 +674,13 @@ void apdu_handler(BACNET_ADDRESS *src,
len += decode_enumerated(&apdu[len], len_value, &error_code);
if (service_choice ==
SERVICE_CONFIRMED_PRIVATE_TRANSFER) { /* skip over
closing tag 0 */
if (decode_is_closing_tag_number(&apdu[len], 0)) {
len++; /* a tag number of 0 is not extended so only one
octet */
SERVICE_CONFIRMED_PRIVATE_TRANSFER) {
if (len < apdu_len) {
/* skip over closing tag 0 */
if (decode_is_closing_tag_number(&apdu[len], 0)) {
len++; /* a tag number of 0 is not extended so
only one octet */
}
}
}
}