Exploit database

GH-9a017fa45abc7e1f8f6ba6e1285cae54

iplayforsg/cve-2023-51444

GitHubNot listedPoC
Download repository ZIP

Sources for CVE-2023-51444

1 source

Preferred order: Exploit-DB, Metasploit, then GitHub repositories by stars.

Repository files7

Files from this repository share one source choice. Supporting files may cover other vulnerabilities.

extension/importer/core/src/main/java/org/geoserver/importer/format/KMLTransformingFeatureReader.java

Java · 1,995 bytes
/* (c) 2014 Open Source Geospatial Foundation - all rights reserved
 * (c) 2001 - 2013 OpenPlans
 * This code is licensed under the GPL 2.0 license, available at the root
 * application directory.
 */
package org.geoserver.importer.format;

import java.io.IOException;
import java.io.InputStream;
import org.geoserver.importer.transform.KMLPlacemarkTransform;
import org.geotools.data.FeatureReader;
import org.opengis.feature.simple.SimpleFeature;
import org.opengis.feature.simple.SimpleFeatureType;

public class KMLTransformingFeatureReader
        implements FeatureReader<SimpleFeatureType, SimpleFeature> {

    private final SimpleFeatureType featureType;

    private final FeatureReader<SimpleFeatureType, SimpleFeature> reader;

    private static final KMLPlacemarkTransform placemarkTransformer = new KMLPlacemarkTransform();

    public KMLTransformingFeatureReader(SimpleFeatureType featureType, InputStream inputStream) {
        this(featureType, new KMLRawFeatureReader(inputStream, featureType));
    }

    public KMLTransformingFeatureReader(
            SimpleFeatureType featureType, FeatureReader<SimpleFeatureType, SimpleFeature> reader) {
        this.featureType = featureType;
        this.reader = reader;
    }

    @Override
    public SimpleFeatureType getFeatureType() {
        return featureType;
    }

    @Override
    public boolean hasNext() {
        try {
            return reader.hasNext();
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
    }

    @Override
    public SimpleFeature next() {
        SimpleFeature feature;
        try {
            feature = reader.next();
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
        SimpleFeature transformedFeature =
                placemarkTransformer.convertFeature(feature, featureType);
        return transformedFeature;
    }

    @Override
    public void close() throws IOException {
        reader.close();
    }
}