Skip to content

AP_ONVIF: tighten string handling#32824

Draft
vlordier wants to merge 1 commit intoArduPilot:masterfrom
vlordier:pr/ap-onvif-string-safety
Draft

AP_ONVIF: tighten string handling#32824
vlordier wants to merge 1 commit intoArduPilot:masterfrom
vlordier:pr/ap-onvif-string-safety

Conversation

@vlordier
Copy link
Copy Markdown

@vlordier vlordier commented Apr 18, 2026

This draft isolates the AP_ONVIF string-handling cleanup from the larger hardening branch.

Summary:

  • tighten string and buffer handling in AP_ONVIF
  • add focused regression coverage for bounded-copy truncation and guaranteed termination, including empty-string edge cases

Why:

  • this is a narrow library-local change and is easier to review separately from the rest of the branch

Validation:

  • branch was split cleanly from upstream/master
  • the branch includes focused regression test source for the string truncation / termination cases in this slice
  • not fully validated locally as a standalone branch beyond the split and commit flow
  • draft only pending review

Comment on lines +52 to +57
// Initialise length trackers so the first call to start() performs
// correct comparison and allocation.
username_len = 0;
password_len = 0;
hostname_len = 0;
profile_token_size = 0;
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.

This is garbage.

Please re-do your static analysis taking into account our assumptions about zeroed memory.

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