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

Reject names with null-bytes in NamedLock::create. #5

Merged
merged 1 commit into from
Sep 1, 2022

Conversation

ryanavella
Copy link
Contributor

Currently it is possible to produce a panic on Windows with the following:

NamedLock::create("\0 foo");

(notice no .unwrap() is required)

There is also inconsistent behavior between platforms. On Windows the name "\0" is treated equivalent to an empty string, but on Unix "" is just fine while "\0" results in Err(Error::CreateFailed).

The simplest fix I can think of is to reject null-bytes altogether, in addition to \ and /. I think this is technically a breaking change, but a minor one.

@oblique oblique merged commit 20c0f21 into oblique:master Sep 1, 2022
@oblique
Copy link
Owner

oblique commented Sep 1, 2022

Thanks! I will create a release in few days.

@oblique
Copy link
Owner

oblique commented Sep 17, 2022

named-lock 0.3.0 is released! Thanks!

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