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

ASCIIPropertyListParser fails to read file that contains only comment #67

Closed
jpstotz opened this issue Aug 30, 2021 · 0 comments
Closed
Assignees
Labels

Comments

@jpstotz
Copy link
Contributor

jpstotz commented Aug 30, 2021

I encountered an empty plist file in old ASCII format:

/* Localized versions of Info.plist keys */

If you use dd-plist to parse such a file you end up with the following exception:

java.lang.ArrayIndexOutOfBoundsException: 45
	at com.dd.plist.ASCIIPropertyListParser.accept(ASCIIPropertyListParser.java:267)
	at com.dd.plist.ASCIIPropertyListParser.skipWhitespacesAndComments(ASCIIPropertyListParser.java:353)
	at com.dd.plist.ASCIIPropertyListParser.parse(ASCIIPropertyListParser.java:430)
	at com.dd.plist.ASCIIPropertyListParser.parse(ASCIIPropertyListParser.java:238)
	at com.dd.plist.ASCIIPropertyListParser.parse(ASCIIPropertyListParser.java:220)
	at com.dd.plist.ASCIIPropertyListParser.parse(ASCIIPropertyListParser.java:172)
	at com.dd.plist.ASCIIPropertyListParser.parse(ASCIIPropertyListParser.java:127)

If I interpret the description of such ASCII plist files correctly the file should be valid https://en.wikipedia.org/wiki/Property_list#NeXTSTEP

At least I would have expected a ParseException instead of an ArrayIndexOutOfBoundsException

BTW: I noticed that the Unit test
https://github.com/3breadt/dd-plist/blob/master/src/test/java/com/dd/plist/test/ParseTest.java#L149-L167
contains a lot of tests that are disabled as they miss the @Test annotation. Are those tests disabled intentionally or is this a bug?

@3breadt 3breadt self-assigned this Aug 30, 2021
@3breadt 3breadt added the bug label Aug 30, 2021
@3breadt 3breadt closed this as completed Aug 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants