File tree Expand file tree Collapse file tree 3 files changed +29
-0
lines changed Expand file tree Collapse file tree 3 files changed +29
-0
lines changed Original file line number Diff line number Diff line change 22
33on :
44 push :
5+ pull_request :
56
67jobs :
78 build :
Original file line number Diff line number Diff line change @@ -220,5 +220,7 @@ function parsePlistXML (node) {
220220
221221 } else if ( node . nodeName === 'false' ) {
222222 return false ;
223+ } else {
224+ throw new Error ( 'Invalid PLIST tag ' + node . nodeName ) ;
223225 }
224226}
Original file line number Diff line number Diff line change @@ -519,4 +519,30 @@ int main(int argc, char *argv[])
519519 } ) ;
520520 } ) ;
521521 } ) ;
522+ describe ( 'invalid formats' , function ( ) {
523+ it ( 'should fail parsing invalid xml plist' , function ( ) {
524+ var xml = multiline ( function ( ) {
525+ /*
526+ <?xml version="1.0" encoding="UTF-8"?>
527+ <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
528+ <plist version="1.0">
529+ <dict>
530+ <key>test</key>
531+ <strong>Testing</strong>
532+ <key>bar</key>
533+ <string></string>
534+ </dict>
535+ </plist>
536+ */
537+ } ) ;
538+ assert . throws ( function ( ) {
539+ var parsed = parse ( xml ) ;
540+ } ) ;
541+ } ) ;
542+ it ( 'ensure empty strings arent valid plist' , function ( ) {
543+ assert . throws ( function ( ) {
544+ var parsed = parse ( '' ) ;
545+ } ) ;
546+ } ) ;
547+ } ) ;
522548} ) ;
You can’t perform that action at this time.
0 commit comments