jmeter-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pmoua...@apache.org
Subject svn commit: r1854217 - in /jmeter/trunk: src/core/org/apache/jmeter/util/JMeterUtils.java src/protocol/jms/org/apache/jmeter/protocol/jms/sampler/render/ObjectMessageRenderer.java xdocs/changes.xml
Date Sat, 23 Feb 2019 15:35:32 GMT
Author: pmouawad
Date: Sat Feb 23 15:35:32 2019
New Revision: 1854217

URL: http://svn.apache.org/viewvc?rev=1854217&view=rev
Log:
Bug 63202 - JMS Publisher : ObjectMessageRenderer creates XStream instance with unitialized
security
Bugzilla Id: 63202

Modified:
    jmeter/trunk/src/core/org/apache/jmeter/util/JMeterUtils.java
    jmeter/trunk/src/protocol/jms/org/apache/jmeter/protocol/jms/sampler/render/ObjectMessageRenderer.java
    jmeter/trunk/xdocs/changes.xml

Modified: jmeter/trunk/src/core/org/apache/jmeter/util/JMeterUtils.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/util/JMeterUtils.java?rev=1854217&r1=1854216&r2=1854217&view=diff
==============================================================================
--- jmeter/trunk/src/core/org/apache/jmeter/util/JMeterUtils.java (original)
+++ jmeter/trunk/src/core/org/apache/jmeter/util/JMeterUtils.java Sat Feb 23 15:35:32 2019
@@ -1315,4 +1315,13 @@ public class JMeterUtils implements Unit
                 .append(elementName)
                 .toString();
     }
+
+    /** 
+     * @return {@link XStream} XStream instance following JMeter security policy
+     */
+    public static final XStream createXStream() {
+        XStream xstream = new XStream();
+        JMeterUtils.setupXStreamSecurityPolicy(xstream);
+        return xstream;
+    }
 }

Modified: jmeter/trunk/src/protocol/jms/org/apache/jmeter/protocol/jms/sampler/render/ObjectMessageRenderer.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/protocol/jms/org/apache/jmeter/protocol/jms/sampler/render/ObjectMessageRenderer.java?rev=1854217&r1=1854216&r2=1854217&view=diff
==============================================================================
--- jmeter/trunk/src/protocol/jms/org/apache/jmeter/protocol/jms/sampler/render/ObjectMessageRenderer.java
(original)
+++ jmeter/trunk/src/protocol/jms/org/apache/jmeter/protocol/jms/sampler/render/ObjectMessageRenderer.java
Sat Feb 23 15:35:32 2019
@@ -66,8 +66,7 @@ class ObjectMessageRenderer implements M
     public Serializable getValueFromText(final String xmlMessage) {
       Serializable readObject = null;
       try {
-          XStream xstream = new XStream();
-          JMeterUtils.setupXStreamSecurityPolicy(xstream);
+          XStream xstream = JMeterUtils.createXStream();
           readObject = (Serializable) xstream.fromXML(xmlMessage, readObject);
       } catch (Exception e) {
           throw new IllegalStateException("Unable to load object instance from text", e);
@@ -86,7 +85,7 @@ class ObjectMessageRenderer implements M
             encoding = findEncoding(filename);
         }
         String stringValue = delegate.getValueFromFile(filename, encoding, hasVariable, cache);
-        value = (Serializable) new XStream().fromXML(stringValue);
+        value = (Serializable) JMeterUtils.createXStream().fromXML(stringValue);
         return value;
     }
 
@@ -102,6 +101,6 @@ class ObjectMessageRenderer implements M
     }
 
     protected Serializable getContent(String filename) {
-        return (Serializable) new XStream().fromXML(new File(filename));
+        return (Serializable) JMeterUtils.createXStream().fromXML(new File(filename));
     }
 }

Modified: jmeter/trunk/xdocs/changes.xml
URL: http://svn.apache.org/viewvc/jmeter/trunk/xdocs/changes.xml?rev=1854217&r1=1854216&r2=1854217&view=diff
==============================================================================
--- jmeter/trunk/xdocs/changes.xml [utf-8] (original)
+++ jmeter/trunk/xdocs/changes.xml [utf-8] Sat Feb 23 15:35:32 2019
@@ -125,6 +125,7 @@ Summary
 
 <h3>Other Samplers</h3>
 <ul>
+    <li><bug>63202</bug>JMS Publisher : ObjectMessageRenderer creates XStream
instance with unitialized security</li>
 </ul>
 
 <h3>Controllers</h3>



Mime
View raw message