Bugfix/service request refactor size check (#553)

* refactor service requests from service header

* add APDU size checking and length feature

* add unit tests to check for length when passing NULL buffer

---------

Co-authored-by: Steve Karg <skarg@users.sourceforge.net>
This commit is contained in:
Steve Karg
2024-01-05 08:59:45 -06:00
committed by GitHub
parent 5ca14e5320
commit bb081d28da
39 changed files with 2614 additions and 1514 deletions
+11 -1
View File
@@ -45,7 +45,6 @@ typedef bool(
extern "C" {
#endif /* __cplusplus */
/* encode service */
BACNET_STACK_EXPORT
int rd_encode_apdu(
uint8_t * apdu,
@@ -53,6 +52,17 @@ extern "C" {
BACNET_REINITIALIZED_STATE state,
BACNET_CHARACTER_STRING * password);
BACNET_STACK_EXPORT
int reinitialize_device_encode(uint8_t *apdu,
BACNET_REINITIALIZED_STATE state,
BACNET_CHARACTER_STRING *password);
BACNET_STACK_EXPORT
size_t reinitialize_device_request_encode(
uint8_t *apdu, size_t apdu_size,
BACNET_REINITIALIZED_STATE state,
BACNET_CHARACTER_STRING *password);
/* decode the service request only */
BACNET_STACK_EXPORT
int rd_decode_service_request(