Skip to content

Bugfix/remote global buffer overflow in apps router - #1392

Merged
skarg merged 11 commits into
masterfrom
bugfix/remote-global-buffer-overflow-in-apps-router
Jun 19, 2026
Merged

Bugfix/remote global buffer overflow in apps router#1392
skarg merged 11 commits into
masterfrom
bugfix/remote-global-buffer-overflow-in-apps-router

Conversation

@skarg

@skarg skarg commented Jun 17, 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 a potential transmit-buffer overflow when routing remote/global APDUs in the router demo apps, while also consolidating router logging onto the stack’s debug_log_fprintf() infrastructure (including parsing log severity from an ASCII value).

Changes:

  • Add debug_log_severity_ascii_set() to set debug severity from a numeric string (e.g., env var).
  • Refactor apps/router-mstp and apps/router-ipv6 routing/logging, introducing routed_apdu_encode() with an explicit oversized-PDU drop check.
  • Harden protocol-version access (avoid reading pdu[0] when pdu_len == 0) and gate IPv6 router main() behind #ifndef FUZZING.

Reviewed changes

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

File Description
src/bacnet/basic/sys/debug.h Exposes new API to set log severity from an ASCII string.
src/bacnet/basic/sys/debug.c Implements ASCII-to-severity parsing via bacnet_strtol().
apps/router-mstp/main.c Switches to debug_log_fprintf(), adds routed APDU encode+size check, updates debug env handling.
apps/router-ipv6/main.c Same routing/logging refactor as MS/TP router + fuzzing guard; adds routed APDU encode+size check.

Comment thread src/bacnet/basic/sys/debug.c Outdated
Comment thread apps/router-mstp/main.c Outdated
Comment thread apps/router-mstp/main.c Outdated
Comment thread apps/router-mstp/main.c Outdated
Comment thread apps/router-ipv6/main.c Outdated
Comment thread apps/router-ipv6/main.c Outdated
Comment thread apps/router-ipv6/main.c Outdated
Comment thread apps/router-ipv6/main.c Outdated
Comment thread apps/router-mstp/main.c Outdated
Comment thread apps/router-ipv6/main.c Outdated

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

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

Comment thread apps/router-mstp/main.c
Comment thread apps/router-mstp/main.c
Comment thread apps/router-mstp/main.c Outdated
Comment thread apps/router-mstp/main.c
Comment thread apps/router-ipv6/main.c
Comment thread apps/router-ipv6/main.c Outdated
Comment thread apps/router-ipv6/main.c Outdated
skarg and others added 2 commits June 18, 2026 23:03
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@skarg
skarg merged commit e2bdbf6 into master Jun 19, 2026
36 checks passed
@skarg
skarg deleted the bugfix/remote-global-buffer-overflow-in-apps-router branch June 19, 2026 04:26
skarg added a commit that referenced this pull request Jun 29, 2026
* Refactor apps/router-mstp and apps/router-ipv6 routing, introducing routed_npdu_apdu_encode() with an explicit oversized-PDU drop check.
* Harden protocol-version access (avoid reading pdu[0] when pdu_len == 0)
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