Skip to content

Fix buffer overflow in Life Safety Point and Zone Read_Property for accepted-modes property - #1354

Merged
skarg merged 4 commits into
masterfrom
bugfix/life-safety-accepted-modes-buffer-overflow
May 19, 2026
Merged

Fix buffer overflow in Life Safety Point and Zone Read_Property for accepted-modes property#1354
skarg merged 4 commits into
masterfrom
bugfix/life-safety-accepted-modes-buffer-overflow

Conversation

@skarg

@skarg skarg commented May 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

This PR aims to prevent buffer overflows when encoding the Accepted-Modes property in the Life Safety Point and Zone objects’ Read_Property handlers by switching to a size-aware enumerated encoder.

Changes:

  • Use bacnet_enumerated_application_encode() to encode each accepted mode with APDU bounds.
  • Track apdu_size in Life_Safety_Point_Read_Property() to compute remaining space during encoding.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
src/bacnet/basic/object/lsz.c Updates Accepted-Modes encoding in Life_Safety_Zone_Read_Property() to use a bounded enumerated encoder.
src/bacnet/basic/object/lsp.c Adds apdu_size tracking and updates Accepted-Modes encoding in Life_Safety_Point_Read_Property() to use a bounded enumerated encoder.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/bacnet/basic/object/lsz.c
Comment thread src/bacnet/basic/object/lsp.c
@skarg
skarg merged commit df184ad into master May 19, 2026
36 checks passed
@skarg
skarg deleted the bugfix/life-safety-accepted-modes-buffer-overflow branch May 19, 2026 14:07
skarg added a commit that referenced this pull request May 26, 2026
skarg added a commit that referenced this pull request May 26, 2026
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