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/cfm/rest/MaWebResource.java b/apps/cfm/nbi/src/main/java/org/onosproject/cfm/rest/MaWebResource.java
index e0390a9..799dc8f 100644
--- a/apps/cfm/nbi/src/main/java/org/onosproject/cfm/rest/MaWebResource.java
+++ b/apps/cfm/nbi/src/main/java/org/onosproject/cfm/rest/MaWebResource.java
@@ -47,6 +47,8 @@
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.node.ObjectNode;
+import static org.onlab.util.Tools.readTreeFromStream;
+
/**
* Layer 2 CFM Maintenance Association web resource.
*/
@@ -143,7 +145,7 @@
}
ObjectMapper mapper = new ObjectMapper();
- JsonNode cfg = mapper.readTree(input);
+ JsonNode cfg = readTreeFromStream(mapper, input);
JsonCodec<MaintenanceAssociation> maCodec =
codec(MaintenanceAssociation.class);
diff --git a/apps/cfm/nbi/src/main/java/org/onosproject/cfm/rest/MdWebResource.java b/apps/cfm/nbi/src/main/java/org/onosproject/cfm/rest/MdWebResource.java
index aa16d9e..1baff3b 100644
--- a/apps/cfm/nbi/src/main/java/org/onosproject/cfm/rest/MdWebResource.java
+++ b/apps/cfm/nbi/src/main/java/org/onosproject/cfm/rest/MdWebResource.java
@@ -43,6 +43,8 @@
import com.fasterxml.jackson.databind.node.ArrayNode;
import com.fasterxml.jackson.databind.node.ObjectNode;
+import static org.onlab.util.Tools.readTreeFromStream;
+
/**
* Layer 2 CFM Maintenance Domain web resource.
*/
@@ -136,7 +138,7 @@
log.debug("POST called to Create MD");
try {
ObjectMapper mapper = new ObjectMapper();
- JsonNode cfg = mapper.readTree(input);
+ JsonNode cfg = readTreeFromStream(mapper, input);
MaintenanceDomain md = codec(MaintenanceDomain.class).decode((ObjectNode) cfg, this);
if (get(CfmMdService.class).createMaintenanceDomain(md)) {
diff --git a/apps/cfm/nbi/src/main/java/org/onosproject/cfm/rest/MepWebResource.java b/apps/cfm/nbi/src/main/java/org/onosproject/cfm/rest/MepWebResource.java
index a9d2c9e..ac4e525 100644
--- a/apps/cfm/nbi/src/main/java/org/onosproject/cfm/rest/MepWebResource.java
+++ b/apps/cfm/nbi/src/main/java/org/onosproject/cfm/rest/MepWebResource.java
@@ -56,6 +56,8 @@
import com.fasterxml.jackson.databind.node.ArrayNode;
import com.fasterxml.jackson.databind.node.ObjectNode;
+import static org.onlab.util.Tools.readTreeFromStream;
+
/**
* Layer 2 CFM Maintenance Association Endpoint (MEP) web resource.
*/
@@ -186,7 +188,7 @@
"MA " + mdName + "/" + maName + " not Found"));
ObjectMapper mapper = new ObjectMapper();
- JsonNode cfg = mapper.readTree(input);
+ JsonNode cfg = readTreeFromStream(mapper(), input);
JsonCodec<Mep> mepCodec = codec(Mep.class);
Mep mep = ((MepCodec) mepCodec).decode((ObjectNode) cfg, this, mdName, maName);
@@ -258,7 +260,7 @@
try {
ObjectMapper mapper = new ObjectMapper();
- JsonNode cfg = mapper.readTree(input);
+ JsonNode cfg = readTreeFromStream(mapper(), input);
JsonCodec<MepLbCreate> mepLbCreateCodec = codec(MepLbCreate.class);
MepLbCreate lbCreate = mepLbCreateCodec.decode((ObjectNode) cfg, this);
@@ -380,7 +382,7 @@
try {
ObjectMapper mapper = new ObjectMapper();
- JsonNode cfg = mapper.readTree(input);
+ JsonNode cfg = readTreeFromStream(mapper, input);
JsonCodec<MepLtCreate> mepLtCreateCodec = codec(MepLtCreate.class);
MepLtCreate ltCreate = mepLtCreateCodec.decode((ObjectNode) cfg, this);
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);