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

SEC-2410: AclFormattingUtils.printBinary does not handle negative #2631

Closed
spring-issuemaster opened this issue Nov 22, 2013 · 2 comments

Comments

Projects
None yet
2 participants
@spring-issuemaster
Copy link

commented Nov 22, 2013

Cedomir Igaly (Migrated from SEC-2410) said:

When printBinary in invoked with negative argument i it will either throw StringIndexOutOfBoundsException or return wrong result. All versions are affected.

Problem is in Integer.toString(i, 2) which is prepending minus sign in the front of the string for negative numbers.

Solution is to replace that call by Integer.toBinaryString(i)

Attached are diff with patch and two simple tests that are failing with current implementation.

@spring-issuemaster

This comment has been minimized.

Copy link
Author

commented Nov 22, 2013

Cedomir Igaly said:

Corrected version.

@spring-issuemaster

This comment has been minimized.

Copy link
Author

commented Nov 22, 2013

Rob Winch said:

Thank you for your submission. This has been fixed in master

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.