undefect. CWE-407 — 63 sites patched across 27 ecosystems
Authors: russell@unturf.com · brackishbert@gmail.com · foxhop.net · TimeHexOn.com Patches, unit tests, benchmarks, whitepaper, and outreach briefs. Public domain — no copyright claimed. Use freely.
This commit is contained in:
commit
0a580b313d
70422 changed files with 17213626 additions and 0 deletions
9
test/jdk/java/util/Properties/invalidxml/BadCase.xml
Normal file
9
test/jdk/java/util/Properties/invalidxml/BadCase.xml
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">
|
||||
|
||||
<!-- XML tags are case sensitve, opening and closing tags must use same case -->
|
||||
|
||||
<properties>
|
||||
<entry key="foo">bar</entry>
|
||||
<entry key="gus">baz</entry>
|
||||
</PROPERTIES>
|
||||
9
test/jdk/java/util/Properties/invalidxml/BadDocType.xml
Normal file
9
test/jdk/java/util/Properties/invalidxml/BadDocType.xml
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE namevaluepairs SYSTEM "http://java.sun.com/dtd/properties.dtd">
|
||||
|
||||
<!-- The root element for a XML properties document is properties -->
|
||||
|
||||
<properties>
|
||||
<entry key="foo">bar</entry>
|
||||
<entry key="gus">baz</entry>
|
||||
</properties>
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
<?xml version="1.0" encoding="utf8" standalone="no"?>
|
||||
<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">
|
||||
|
||||
<!-- XML tags are case sensitve, the root element should have been in lower case -->
|
||||
|
||||
<Properties>
|
||||
<comment>comment</comment>
|
||||
<entry key="firstKey">value of the first key</entry>
|
||||
</Properties>
|
||||
10
test/jdk/java/util/Properties/invalidxml/IllegalComment.xml
Normal file
10
test/jdk/java/util/Properties/invalidxml/IllegalComment.xml
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
<?xml version="1.0" encoding="utf8" standalone="no"?>
|
||||
<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">
|
||||
|
||||
<!-- The dtd allows zero or one comment element -->
|
||||
|
||||
<properties>
|
||||
<comment>comment1</comment>
|
||||
<comment>comment2</comment>
|
||||
<entry key="firstKey">value of the first key</entry>
|
||||
</properties>
|
||||
11
test/jdk/java/util/Properties/invalidxml/IllegalElement.xml
Normal file
11
test/jdk/java/util/Properties/invalidxml/IllegalElement.xml
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
<?xml version="1.0" encoding="utf8" standalone="no"?>
|
||||
<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">
|
||||
|
||||
<!-- The dtd requires a properties root, but not element -->
|
||||
|
||||
<properties>
|
||||
<comment>comment</comment>
|
||||
<properties>
|
||||
<entry key="firstKey">value of the first key</entry>
|
||||
</properties>
|
||||
</properties>
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
<?xml version="1.0" encoding="utf8" standalone="no"?>
|
||||
<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">
|
||||
|
||||
<!-- The dtd requires 'entry' element, 'Entry' is illegal -->
|
||||
|
||||
<properties>
|
||||
<comment>comment</comment>
|
||||
<Entry key="firstKey">value of the first key</Entry>
|
||||
</properties>
|
||||
11
test/jdk/java/util/Properties/invalidxml/IllegalEntry1.xml
Normal file
11
test/jdk/java/util/Properties/invalidxml/IllegalEntry1.xml
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
<?xml version="1.0" encoding="utf8" standalone="no"?>
|
||||
<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">
|
||||
|
||||
<!-- 'entry1' is illegal as per the dtd -->
|
||||
|
||||
<properties>
|
||||
<comment>comment1</comment>
|
||||
|
||||
<entry key="firstkey">value of the first key</entry>
|
||||
<entry1 key="secondkey">value of the second key</entry1>
|
||||
</properties>
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
<?xml version="1.0" encoding="utf8" standalone="no"?>
|
||||
<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">
|
||||
|
||||
<!-- 'key' attribute is expected. 'key1' is mistyped -->
|
||||
|
||||
<properties>
|
||||
<comment>comment1</comment>
|
||||
<entry key1="typo">value of the first key</entry>
|
||||
</properties>
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">
|
||||
|
||||
<!-- XML elements must having a closing tag -->
|
||||
|
||||
<properties>
|
||||
<entry key="foo">bar</entry>
|
||||
<entry key="gus">baz</entry>
|
||||
8
test/jdk/java/util/Properties/invalidxml/NoDocType.xml
Normal file
8
test/jdk/java/util/Properties/invalidxml/NoDocType.xml
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
|
||||
<!-- An XML properties document has the DOCTYPE declaration with the properties root element -->
|
||||
|
||||
<properties>
|
||||
<entry key="foo">bar</entry>
|
||||
<entry key="gus">baz</entry>
|
||||
</properties>
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
<?xml version="1.0" encoding="utf8" standalone="no"?>
|
||||
<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">
|
||||
|
||||
<!-- namespace is not supported -->
|
||||
|
||||
<javautil:properties xmlns:javautil="http://java.sun.com/java/util/Properties">
|
||||
<javautil:comment>comment1</javautil:comment>
|
||||
|
||||
<javautil:entry key="firstkey">value of the first key</javautil:entry>
|
||||
<javautil:entry key="secondkey">value of the second key</javautil:entry>
|
||||
</javautil:properties>
|
||||
4
test/jdk/java/util/Properties/invalidxml/NoRoot.xml
Normal file
4
test/jdk/java/util/Properties/invalidxml/NoRoot.xml
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">
|
||||
|
||||
<!-- XML documents must have a root element -->
|
||||
9
test/jdk/java/util/Properties/invalidxml/NotQuoted.xml
Normal file
9
test/jdk/java/util/Properties/invalidxml/NotQuoted.xml
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">
|
||||
|
||||
<!-- XML attribute values must be quoted -->
|
||||
|
||||
<properties>
|
||||
<entry key=foo>bar</entry>
|
||||
<entry key=gus>baz</entry>
|
||||
</properties>
|
||||
5
test/jdk/java/util/Properties/invalidxml/README.txt
Normal file
5
test/jdk/java/util/Properties/invalidxml/README.txt
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
|
||||
This directory contains test cases for the LoadAndStoreXML test case. Each file
|
||||
in this directory should be a malformed XML document that should cause the
|
||||
java.util.Properties loadFromXML method to throw InvalidPropertiesFormatException.
|
||||
|
||||
10
test/jdk/java/util/Properties/invalidxml/invalidDTD.xml
Normal file
10
test/jdk/java/util/Properties/invalidxml/invalidDTD.xml
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd"
|
||||
[<!ENTITY intEnt 'value3'> ]>
|
||||
<?PITarget PIContent?>
|
||||
<properties>
|
||||
<comment>Property With Other Encoding</comment>
|
||||
<entry key="Key1">value1</entry>
|
||||
<entry key="Key2"><![CDATA[<value2>]]></entry>
|
||||
<entry key="Key3">&intEnt;</entry>
|
||||
</properties>
|
||||
Loading…
Add table
Add a link
Reference in a new issue