Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Small fixes to improve code, fix crash condition #2335

Merged
merged 3 commits into from
Nov 12, 2024

Conversation

kevemueller
Copy link

Small fixes to improve the codebase.
Major improvement in pkg_add behaviour on MacOS/amd64|arm64. The process crashed due to improper use of strlcpy, with this improvement, 9 kyua tests related to pkg_add pass.

Keve added 3 commits November 12, 2024 09:38
strlcpy has undefined behaviour in case the copied string regions overlap. On platforms with a vector optimized memcpy implementation, overlapping regions may crash the process e.g. with
Child process pid=0 terminated abnormally: Illegal instruction: 4

At this call-site the strlcpy parameters almost certainly overlap. Refactor the code to do the intended functionality in-place.
@bapt bapt merged commit a4a647b into freebsd:main Nov 12, 2024
7 checks passed
@kevemueller kevemueller deleted the smallfixes branch November 12, 2024 09:28
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