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

Ensure strings are absent of extra zeroes #703

Closed
wants to merge 1 commit into from

Conversation

someoneigna
Copy link
Contributor

Checks for extra zeroes in strings passed to libgit2 functions.

Fixes #571

@@ -195,7 +202,7 @@ static void DoFetch(RemoteSafeHandle remoteHandle, FetchOptions options, Signatu
{
Ensure.ArgumentNotNull(remote, "remote");
Ensure.ArgumentNotNull(objectish, "objectish");
Ensure.ArgumentNotNullOrEmptyString(destinationSpec, destinationSpec);
Ensure.ArgumentNotNullOrEmptyString(destinationSpec, "destinationSpec");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch.

@@ -100,6 +101,8 @@ public virtual Remote Add(string name, string url)
{
Ensure.ArgumentNotNull(name, "name");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this may also rather be NotNullOrEmpty

@someoneigna
Copy link
Contributor Author

This one should do, or I will get killed for my incompetence 😱 😄

@nulltoken
Copy link
Member

@someoneigna The builds appears to fail. Could you please review the logs?

@@ -92,6 +92,8 @@ static void DoFetch(RemoteSafeHandle remoteHandle, FetchOptions options, Signatu
Proxy.git_remote_set_autotag(remoteHandle, options.TagFetchMode.Value);
}

Ensure.ArgumentDoesNotContainZeroByte(logMessage, "logMessage");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe move this to the top of the method, as we tend to do for arg validation?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done 👍

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.

None yet

6 participants