diff --git a/bacnet-stack/bacerror.c b/bacnet-stack/bacerror.c index 8ba2130e..178471f0 100644 --- a/bacnet-stack/bacerror.c +++ b/bacnet-stack/bacerror.c @@ -116,7 +116,8 @@ int bacerror_decode_service_request( *service = apdu[1]; // decode the application class and code len = bacerror_decode_error_class_and_code( - apdu[2], + &apdu[2], + apdu_len - 2, error_class, error_code); }