Ignore:
Timestamp:
2016-08-02T12:56:49+02:00 (3 years ago)
Author:
Don-vip
Message:

fix #13260 - Disable DTD resolution when loading .osm files

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/io/OsmReader.java

    r10627 r10702  
    585585
    586586            try (InputStreamReader ir = UTFInputStreamReader.create(source)) {
    587                 XMLStreamReader parser = XMLInputFactory.newInstance().createXMLStreamReader(ir);
    588                 setParser(parser);
     587                XMLInputFactory factory = XMLInputFactory.newInstance();
     588                // do not try to load external entities
     589                factory.setProperty(XMLInputFactory.IS_SUPPORTING_EXTERNAL_ENTITIES, Boolean.FALSE);
     590                factory.setProperty(XMLInputFactory.SUPPORT_DTD, Boolean.FALSE);
     591                setParser(factory.createXMLStreamReader(ir));
    589592                parse();
    590593            }
Note: See TracChangeset for help on using the changeset viewer.