After the latest change in revision 1910(https://sourceforge.net/p/jmrtd/code/1910/), a regression was introduced in the file selection logic.
The following code was added:
} catch (CardServiceException cse) {
fileInfo = new DefaultFileInfo(selectedFID, -1);
fileInfos.put(selectedFID, fileInfo);
return fileInfo;
}
Later, when the code assumes that the selected file really exists and tries to use this fileInfo to read from the card (e.g. via READ BINARY or similar operations), a NullPointerException occurs, since the file was never present and the previous CardServiceException was effectively ignored.
Before this change, a CardServiceException correctly indicated that the file could not be selected, so the caller could handle the error (e.g. by skipping the optional file).
Now the error is hidden by constructing a synthetic DefaultFileInfo with length -1, which misleads the rest of the code into thinking the file exists.
Steps to reproduce:
Anonymous
Do you have a (partial) stack trace?
Sure, here you are: