Skip to content

fix(initsystem): prevent in-place buffer mutation when resolving symlinked init executable - #2717

Merged
CarterLi merged 1 commit into
fastfetch-cli:devfrom
pro-laxmi:fix/initsystem-basename-mod
Nov 14, 2026
Merged

CarterLi merged 1 commit into
fastfetch-cli:devfrom
pro-laxmi:fix/initsystem-basename-mod

Conversation

@pro-laxmi

@pro-laxmi pro-laxmi commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Prevent in-place buffer mutation when resolving symlinked init executable by isolating the POSIX basename() argument inside a separate buffer.

Changes

  • In src/detection/initsystem/initsystem_linux.c: copy buf into stack buffer baseBuf before invoking POSIX basename(), preventing in-place path mutation.
  • Verified accurate init detection via ./build/fastfetch --initsystem.

Checklist

  • I have tested my changes locally.
    • Ran ctest --test-dir build --output-on-failure: 20/20 tests passed cleanly.

@CarterLi
CarterLi merged commit 2b299cf into fastfetch-cli:dev Nov 14, 2026
25 of 26 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