Changed BACnetPropertyStates to support more enumerations. Added apdu size checking on decode. Removed BACnetPropertyStates local enumeration. Increased BACnetPropertyStates codec unit test coverage.
This commit is contained in:
@@ -498,7 +498,9 @@ int bacnet_tag_decode(uint8_t *apdu, uint32_t apdu_size, BACNET_TAG *tag)
|
||||
bool closing_tag = false;
|
||||
uint32_t len_value_type = 0;
|
||||
|
||||
len = bacnet_tag_number_decode(&apdu[0], apdu_size, &tag_number);
|
||||
if (apdu && (apdu_size > 0)) {
|
||||
len = bacnet_tag_number_decode(&apdu[0], apdu_size, &tag_number);
|
||||
}
|
||||
if (len > 0) {
|
||||
if (IS_EXTENDED_VALUE(apdu[0])) {
|
||||
if (apdu_size > len) {
|
||||
@@ -1121,11 +1123,7 @@ int bacnet_boolean_context_decode(
|
||||
apdu_len = len;
|
||||
if (apdu_len < apdu_size) {
|
||||
if (boolean_value) {
|
||||
if (apdu[apdu_len]) {
|
||||
*boolean_value = true;
|
||||
} else {
|
||||
*boolean_value = false;
|
||||
}
|
||||
*boolean_value = decode_context_boolean(&apdu[apdu_len]);
|
||||
}
|
||||
apdu_len++;
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user