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

bsg_strncpy should terminate dst even if src is NULL #1637

Merged
merged 1 commit into from
Mar 23, 2022

Conversation

lemnik
Copy link
Contributor

@lemnik lemnik commented Mar 23, 2022

Goal

Passing a NULL source string to bsg_strncpy should still \0 terminate the destination string if there is available space (dst_size > 0).

Testing

A new unit test was added to cover the functionality

@lemnik lemnik requested a review from kattrali March 23, 2022 14:43
@lemnik lemnik merged commit 82d3513 into next Mar 23, 2022
@lemnik lemnik deleted the PLAT-8208/strncpy-fix branch March 23, 2022 15:32
@lemnik lemnik mentioned this pull request Mar 31, 2022
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