Skip to content

fix buffer overflow when iterating through EMPTY_FEATURES#82

Merged
prokopyl merged 2 commits intoprokopyl:mainfrom
edwloef:owned-c-string-array-empty
Apr 29, 2026
Merged

fix buffer overflow when iterating through EMPTY_FEATURES#82
prokopyl merged 2 commits intoprokopyl:mainfrom
edwloef:owned-c-string-array-empty

Conversation

@edwloef
Copy link
Copy Markdown
Contributor

@edwloef edwloef commented Apr 18, 2026

OwnedCString::empty() isn't null, but rather a pointer to a static empty C string. However, OwnedCStringArray needs to be null-terminated (which the host needs to rely on when iterating through plugin features) so the only element in an empty OwnedCStringArray needs to be null.

@edwloef edwloef force-pushed the owned-c-string-array-empty branch from 397201b to 9eaf919 Compare April 18, 2026 18:27
@prokopyl
Copy link
Copy Markdown
Owner

Ah yes good catch, thanks!

@prokopyl prokopyl merged commit caac14a into prokopyl:main Apr 29, 2026
17 checks passed
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