Fixed datetime decode of invalid tag. (#495)

* Fixed datetime decode of invalid application tag.

---------

Co-authored-by: Steve Karg <skarg@users.sourceforge.net>
This commit is contained in:
Steve Karg
2023-09-12 15:11:52 -05:00
committed by GitHub
parent e9bdb15684
commit b14177672b
3 changed files with 74 additions and 64 deletions
+2 -2
View File
@@ -1125,7 +1125,7 @@ int bacnet_datetime_decode(
}
len = bacnet_date_application_decode(
&apdu[apdu_len], apdu_size - apdu_len, bdate);
if (len < 0) {
if (len <= 0) {
return BACNET_STATUS_ERROR;
}
apdu_len += len;
@@ -1134,7 +1134,7 @@ int bacnet_datetime_decode(
}
len = bacnet_time_application_decode(
&apdu[apdu_len], apdu_size - apdu_len, btime);
if (len < 0) {
if (len <= 0) {
return BACNET_STATUS_ERROR;
}
apdu_len += len;