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

ECUtil.getNamedCurveOid does not safely handle strings with space at last position #1869

Open
kares opened this issue Oct 16, 2024 · 1 comment

Comments

@kares
Copy link

kares commented Oct 16, 2024

e.g.

org.bouncycastle.jcajce.provider.asymmetric.util.ECUtil.getNamedCurveOid(" ");

is going to lead to a java.lang.StringIndexOutOfBoundsException: String index out of range: 0 due the assumption that after a ' ' char there's still another character

@dghgit
Copy link
Contributor

dghgit commented Oct 18, 2024

I've changed it to now do a trim() after the null check. Thanks for the report.

hubot pushed a commit that referenced this issue Oct 18, 2024
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

No branches or pull requests

2 participants