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

Issues about empty <key /> tag #66

Open
xiangpingmeng opened this issue Dec 6, 2015 · 3 comments
Open

Issues about empty <key /> tag #66

xiangpingmeng opened this issue Dec 6, 2015 · 3 comments

Comments

@xiangpingmeng
Copy link

Generally, a typical plist file may has dictionary:

<key>some key</key>
<string>some value</string>
<key>some key</key>
<string>some value</string>
<key>some key</key>
<string>some value</string>

It is contains some key and values. but I recently work with some real plist files and they has empty tags, for example(such empty key from the Info.plist file .ipa package from AppStore):

<key />
<string />
<key>some key</key>
<string>some value</string>
<key>some key</key>
<string>some value</string>

as a result, this let plist.js parse failed. I check the source code in lib/parse.js in ths project:

//...
 else if (node.nodeName === 'key') {
    return node.childNodes[0].nodeValue;

  }
//...

It clear that node.childNodes[0].nodeValue not check the length of node.childNodes.

As result, if such empty key has encountered, the whole program will crash because index of out bounds error.

So, I think if we could let such index check more safely.

@agoldis
Copy link
Contributor

agoldis commented Jan 26, 2016

+1

agoldis pushed a commit to agoldis/plist.js that referenced this issue Jan 26, 2016
agoldis pushed a commit to agoldis/plist.js that referenced this issue Jan 26, 2016
TooTallNate added a commit that referenced this issue Mar 13, 2016
Fixed empty keys issue #66, added tests
@MSLaguana
Copy link

We've just been bitten by this same issue: microsoft/vscode-cordova#58. Any idea when you'll be publishing the fix to npm?

@otmezger
Copy link

otmezger commented Oct 9, 2016

possible duplicated to #79. The fix proposed there fixed the problem for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants