bc-java icon indicating copy to clipboard operation
bc-java copied to clipboard

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

Open kares opened this issue 1 year ago • 1 comments

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

kares avatar Oct 16 '24 10:10 kares

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

dghgit avatar Oct 18 '24 02:10 dghgit

Fixed in 1.79.

dghgit avatar Nov 03 '24 04:11 dghgit