Skip to content

Remove redundant global path var and fix memory corruption#481

Merged
troglobit merged 1 commit intofinit-project:masterfrom
vazub:pathfix
Mar 4, 2026
Merged

Remove redundant global path var and fix memory corruption#481
troglobit merged 1 commit intofinit-project:masterfrom
vazub:pathfix

Conversation

@vazub
Copy link

@vazub vazub commented Mar 3, 2026

Fixes #479

The use of a global static variable here serves no practical purpose, as it is being assigned only from the conf_parse_cmdline function, where this logic is arguably redundant, because env vars passed by the kernel are already in memory. Therefore, subsequent check and re-assignment of an already existing value is not needed and actually causes an issue described in the link above.

While fixing path, also refactored the use of shell, to the same effect, even though no particular issue has been reported so far.

@troglobit troglobit merged commit 4ce810c into finit-project:master Mar 4, 2026
2 checks passed
@troglobit
Copy link
Collaborator

Nice catch on this, btw!

@vazub vazub deleted the pathfix branch March 6, 2026 20:31
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