Language: Java
Label: vulnerable
CWE: CWE-502 \u2014 Deserialization of Untrusted Data
The product deserializes untrusted data without sufficiently verifying that the resulting data will be valid.

Code:
	public void readData(LPDataInput input) throws IOException {
		pos = input.readLPPosition();
		filterPositions = new EnumMap<>(PipeRoutingConnectionType.class);
		short id;
		while ((id = input.readShort()) != -1) {
			PipeRoutingConnectionType type = PipeRoutingConnectionType.values[id];
			List<List<DoubleCoordinates>> typeFilters = new ArrayList<>();
			int length;
			while ((length = input.readShort()) != -1) {
				List<DoubleCoordinates> linkedFilter = new ArrayList<>();
				for (int i = 0; i < length; i++) {
					linkedFilter.add(input.readLPPosition());
				}
				typeFilters.add(linkedFilter);
			}
			filterPositions.put(type, typeFilters);
		}
	}