Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[jgit-dev] IndexOutOfBoundsException in RawParseUtils.decodeNoFallback

One of our users has reported following exception against an older
version of jgit (so I have skipped line numbers):

 at java.nio.ByteBuffer.wrap
 at org.eclipse.jgit.util.RawParseUtils.decodeNoFallback
 at org.eclipse.jgit.util.RawParseUtils.decode
 at org.eclipse.jgit.util.RawParseUtils.parsePersonIdent
 at org.eclipse.jgit.revwalk.RevCommit.getAuthorIdent

AFAIU this is caused by a strange (or even invalid?) author-line in the
commit. RawParseUtils.parsePersonIdent is not fault-tolerant here. Now
I'm wondering how to fix that best:

Check emailB and emailE and, if these indices are bad, return a PersonIdent?

Or even return null if something is wrong?

As soon as there is agreement on expected behavior I could try to submit
a patch.

Best regards,
Marc Strapetz
syntevo GmbH

Back to the top