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

rgw ldap: protect rgw::from_base64 from non-base64 input #10777

Merged
merged 1 commit into from Aug 18, 2016

Conversation

mattbenjamin
Copy link
Contributor

Also adds unit tests for:

  1. empty output from from_base64 (turns out to be harmless)
  2. random and specific non-base64 and sort strings

Signed-off-by: Matt Benjamin mbenjamin@redhat.com

Also adds unit tests for:
1. empty output from from_base64 (turns out to be harmless)
2. random and specific non-base64 and sort strings

Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
try {
base64_token = rgw::from_base64(access_key_id);
} catch(...) {
base64_token = std::string("");
Copy link
Contributor

Choose a reason for hiding this comment

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

base64_token is already in its default-constructed state, is this necessary?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It feels cleaner to re-assert it in an empty state, at least to me.

@cbodley cbodley merged commit 94d8137 into ceph:master Aug 18, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants