Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[Uid] Fix fromString() with low base58 values #41801

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

Merged
merged 1 commit into from
Jun 23, 2021

Conversation

fancyweb
Copy link
Contributor

Q A
Branch? 5.2
Bug fix? yes
New feature? no
Deprecations? no
Tickets -
License MIT
Doc PR -

When converting base58 values to binary, we forgot to pad the result with null byte, so if the result is too "short", the code breaks.

@@ -187,14 +187,24 @@ public function testCompare()
$this->assertSame([$a, $b, $c, $d], $uuids);
}

public function testNilUuid()
/**
* @testWith ["00000000-0000-0000-0000-000000000000"]
Copy link
Member

Choose a reason for hiding this comment

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

nice one :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

testWith whenever I can now 😎

@nicolas-grekas
Copy link
Member

Good catch, thanks @fancyweb.

@nicolas-grekas nicolas-grekas merged commit 67c3ffa into symfony:5.2 Jun 23, 2021
@fancyweb fancyweb deleted the uid/fixes branch June 24, 2021 07:23
This was referenced Jun 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants