Bug #6043
closedA zero-length command line argument causes an index out-of-bounds exception
100%
Description
If you conspire to pass a zero length string to net.sf.saxon.Transform
as a command line argument, we throw an index out-of-bounds exception.
(How, exactly, you do this is perhaps platform dependent, but it appears that on Windows at least java "" ...
will result in a zero length string being passed as an argument.)
Then the question is, how should we react to this argument? Ignore it, or reject it and print the usage message? I'm leaning towards the latter.
Updated by Norm Tovey-Walsh 12 months ago
This seems to work:
public void setActualOptions(/*@NotNull*/ String[] args) throws XPathException {
for (String arg : args) {
if ("".equals(arg)) {
throw new XPathException("An empty string is not a valid command line option");
} else if ("-".equals(arg)) {
...
Anyone disagree with making it an error or the message?
Updated by Norm Tovey-Walsh 11 months ago
- Status changed from New to Resolved
- Applies to branch 11, 12, trunk added
- Fix Committed on Branch 11, 12, trunk added
Fix pushed to 11, 12, and main.
Updated by O'Neil Delpratt 10 months ago
- Status changed from Resolved to Closed
- % Done changed from 0 to 100
- Fixed in Maintenance Release 12.3 added
Bug fix applied in the Saxon 12.3 maintenance release.
Updated by O'Neil Delpratt 10 months ago
- Status changed from Closed to Resolved
Leaving this bug issue as resolved until resolved against Saxon 11.
Updated by Debbie Lockett 8 months ago
- Status changed from Resolved to Closed
- Fixed in Maintenance Release 11.6 added
Bug fix applied in the Saxon 11.6 maintenance release.
Please register to edit this issue