Upgrade fasterXML libraries for OS-9
Upgrade fasterXML to version 2.9.5 to address security vulnerability
Wrap calls to treeRead(InputStream) to handle new behavior of null streams
Change-Id: Id199cfacd0cf9e5371dc33de9f1e058c2e72eaa5
diff --git a/apps/cfm/nbi/src/main/java/org/onosproject/soam/rest/DmWebResource.java b/apps/cfm/nbi/src/main/java/org/onosproject/soam/rest/DmWebResource.java
index 386ed8c..8677419 100644
--- a/apps/cfm/nbi/src/main/java/org/onosproject/soam/rest/DmWebResource.java
+++ b/apps/cfm/nbi/src/main/java/org/onosproject/soam/rest/DmWebResource.java
@@ -55,6 +55,8 @@
import com.fasterxml.jackson.databind.node.ArrayNode;
import com.fasterxml.jackson.databind.node.ObjectNode;
+import static org.onlab.util.Tools.readTreeFromStream;
+
/**
* Layer 2 SOAM Delay Measurement web resource.
*/
@@ -199,7 +201,7 @@
}
ObjectMapper mapper = new ObjectMapper();
- JsonNode cfg = mapper.readTree(input);
+ JsonNode cfg = readTreeFromStream(mapper, input);
JsonCodec<DelayMeasurementCreate> dmCodec = codec(DelayMeasurementCreate.class);
DelayMeasurementCreate dm = dmCodec.decode((ObjectNode) cfg, this);
diff --git a/apps/cfm/nbi/src/main/java/org/onosproject/soam/rest/LmWebResource.java b/apps/cfm/nbi/src/main/java/org/onosproject/soam/rest/LmWebResource.java
index 245396c..0c5307f 100644
--- a/apps/cfm/nbi/src/main/java/org/onosproject/soam/rest/LmWebResource.java
+++ b/apps/cfm/nbi/src/main/java/org/onosproject/soam/rest/LmWebResource.java
@@ -53,6 +53,8 @@
import java.net.URISyntaxException;
import java.util.Collection;
+import static org.onlab.util.Tools.readTreeFromStream;
+
/**
* Layer 2 SOAM Loss Measurement web resource.
*/
@@ -197,7 +199,7 @@
}
ObjectMapper mapper = new ObjectMapper();
- JsonNode cfg = mapper.readTree(input);
+ JsonNode cfg = readTreeFromStream(mapper, input);
JsonCodec<LossMeasurementCreate> lmCodec = codec(LossMeasurementCreate.class);
LossMeasurementCreate lm = lmCodec.decode((ObjectNode) cfg, this);