Skip to content

Bugfix/atomic read file out of bounds write - #1340

Merged
skarg merged 5 commits into
masterfrom
bugfix/atomic-read-file-out-of-bounds-write
May 8, 2026
Merged

Bugfix/atomic read file out of bounds write#1340
skarg merged 5 commits into
masterfrom
bugfix/atomic-read-file-out-of-bounds-write

Conversation

@skarg

@skarg skarg commented May 7, 2026

Copy link
Copy Markdown
Collaborator

A crafted request can set an excessively large RecordCount, which is later used as the loop bound for writing record data into a stack-allocated BACNET_ATOMIC_READ_FILE_DATA data structure. However, the stack object only has space for one fileData element. When the loop reaches i = 1, the code computes &data->fileData[1], which is already out of bounds, and the resulting invalid pointer is passed down to memmove(), causing a stack-buffer-overflow.

@skarg
skarg merged commit dc558b3 into master May 8, 2026
36 checks passed
@skarg
skarg deleted the bugfix/atomic-read-file-out-of-bounds-write branch May 8, 2026 03:17
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.

1 participant