Skip to content

Bugfix/buffer overflow in readpropm via malformed readpropertymultiple ack - #1395

Merged
skarg merged 3 commits into
masterfrom
bugfix/buffer-overflow-in-readpropm-via-malformed-readpropertymultiple-ack
Jun 25, 2026
Merged

Bugfix/buffer overflow in readpropm via malformed readpropertymultiple ack#1395
skarg merged 3 commits into
masterfrom
bugfix/buffer-overflow-in-readpropm-via-malformed-readpropertymultiple-ack

Conversation

@skarg

@skarg skarg commented Jun 19, 2026

Copy link
Copy Markdown
Collaborator

No description provided.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread src/bacnet/basic/service/h_rpm_a.c Outdated
@skarg
skarg merged commit 908ee4c into master Jun 25, 2026
36 checks passed
@skarg
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants