Skip to content

Commit 6438b65

Browse files
committed
Improve comment for BEAStAXDrvier concerning external entities.
1 parent 812a0fa commit 6438b65

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

xstream/src/java/com/thoughtworks/xstream/io/xml/BEAStaxDriver.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,9 @@ public BEAStaxDriver(final NameCoder nameCoder) {
6767
@Override
6868
protected XMLInputFactory createInputFactory() {
6969
final XMLInputFactory instance = new MXParserFactory();
70-
// instance.setProperty(XMLInputFactory.IS_SUPPORTING_EXTERNAL_ENTITIES, true);
70+
instance.setProperty(XMLInputFactory.IS_SUPPORTING_EXTERNAL_ENTITIES, false);
71+
// if (instance.isPropertySupported(XMLInputFactory.IS_SUPPORTING_EXTERNAL_ENTITIES))
72+
// throw new IllegalStateException("Should not support extgernal entities now!");
7173
return instance;
7274
}
7375

xstream/src/test/com/thoughtworks/xstream/io/xml/BEAStaxReaderTest.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,7 @@ protected HierarchicalStreamReader createReader(final String xml) throws Excepti
2828

2929
@Override
3030
public void testIsXXEVulnerable() throws Exception {
31-
// Implementation wrongly claims not to handle external entities.
32-
// On top it ignores XMLInputFactory.IS_SUPPORTING_EXTERNAL_ENTITIES !!
31+
// Implementation ignores XMLInputFactory.IS_SUPPORTING_EXTERNAL_ENTITIES set to false.
3332
// super.testIsXXEVulnerable();
3433
}
3534

0 commit comments

Comments
 (0)