Bugfix/buffer overflow in readpropm via malformed readpropertymultiple ack - #1395
Merged
skarg merged 3 commits intoJun 25, 2026
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes a potential buffer-overread/overflow scenario in the ReadPropertyMultiple ACK decoding path when the tag-4 propertyValue payload is malformed/truncated, and adds a unit test to prevent regressions.
Changes:
- Harden
rpm_ack_decode_service_request()to validate enclosed tag lengths and detect decoded element lengths exceeding the tag-4 payload. - Add a new ztest unit test that builds a malformed RPM ACK with a truncated value and asserts the decoder returns
BACNET_STATUS_ERROR. - Register the new test directory in the test CMake build.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
src/bacnet/basic/service/h_rpm_a.c |
Adds length/remaining-byte tracking and new error checks while decoding tag-4 propertyValue payloads. |
test/CMakeLists.txt |
Includes the new bacnet/basic/service/h_rpm_a test directory in the test build. |
test/bacnet/basic/service/h_rpm_a/CMakeLists.txt |
Adds a new standalone CMake test target for the RPM ACK handler decoder. |
test/bacnet/basic/service/h_rpm_a/src/main.c |
Adds a regression test that feeds a malformed/truncated tag-4 payload and expects decode failure. |
…ecessary data_remaining checks
skarg
deleted the
bugfix/buffer-overflow-in-readpropm-via-malformed-readpropertymultiple-ack
branch
June 25, 2026 14:46
skarg
added a commit
that referenced
this pull request
Jul 2, 2026
…e ack (#1395) * Fix buffer overflow in rpm_ack_decode_service_request by validating data length and remaining bytes * Add unit tests for handler_read_property_multiple_ack decoder paths
skarg
added a commit
that referenced
this pull request
Jul 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.