You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by co...@apache.org on 2022/01/28 10:20:28 UTC

[cxf] branch 3.3.x-fixes updated (757482d -> ed28748)

This is an automated email from the ASF dual-hosted git repository.

coheigea pushed a change to branch 3.3.x-fixes
in repository https://gitbox.apache.org/repos/asf/cxf.git.


    from 757482d  Recording .gitmergeinfo Changes
     new 753ab43  Fixed a bug in Base64Utility not passing the urlSafe parameter
     new aee2895  CXF-8646 - Don't return exception class name when parsing XML
     new ed28748  Recording .gitmergeinfo Changes

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .gitmergeinfo                                      |  2 ++
 .../org/apache/cxf/common/util/Base64Utility.java  |  2 +-
 .../cxf/databinding/source/Messages.properties     |  2 +-
 .../cxf/databinding/source/NodeDataReader.java     |  2 +-
 .../databinding/source/XMLStreamDataReader.java    |  4 +--
 .../source/XMLStreamDataReaderTest.java            | 31 +++++++++++++++++++++-
 6 files changed, 37 insertions(+), 6 deletions(-)

[cxf] 03/03: Recording .gitmergeinfo Changes

Posted by co...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

coheigea pushed a commit to branch 3.3.x-fixes
in repository https://gitbox.apache.org/repos/asf/cxf.git

commit ed287486facf5b75b3c9d523f31300947a6ec536
Author: Colm O hEigeartaigh <co...@apache.org>
AuthorDate: Fri Jan 28 09:26:54 2022 +0000

    Recording .gitmergeinfo Changes
---
 .gitmergeinfo | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/.gitmergeinfo b/.gitmergeinfo
index f22db75..12455a0 100644
--- a/.gitmergeinfo
+++ b/.gitmergeinfo
@@ -323,6 +323,7 @@ B 6dd6377021ac0b9b586a0c579c3adfd6950936c8
 B 6eb88763b1ca04b3a9451f994c435e5f821ca449
 B 6ef11c95058077c4eb707077ff99271da581599e
 B 6efe4d7c46fcc6128910027cfbf1b28018a4ada4
+B 6f122936d6e8a6c889a90ae30a4489a23bf46c57
 B 6f774a0cbea695986548029bfe7202d2536ad4d2
 B 6f9303c1e94800ac453cc10e5268024fd2831418
 B 6fbaddee67676f9840405bd49cb7d6e08a81bd23
@@ -371,6 +372,7 @@ B 7d559ec87e45c9c5d8073b5b2887d8919f54a88d
 B 7d815ff8be6562d12f7981c9c3e1caafd892a581
 B 7ea3db6a204ca8099bc9ce4cc099b24f98382810
 B 7eba3a3c1b688b1b9de6d52dcee1ba9957f4d7eb
+B 7ebea0ee7b8da32ed96c5ad2bd371404d228a15e
 B 7f00907652eadf61628b13e673a84df4804dc067
 B 7f20ddfabf5b2ed4c84b1ae6a1cac715f8d6b076
 B 7f23c7401857bd81aac38a27da7a4a47254475c8

[cxf] 01/03: Fixed a bug in Base64Utility not passing the urlSafe parameter

Posted by co...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

coheigea pushed a commit to branch 3.3.x-fixes
in repository https://gitbox.apache.org/repos/asf/cxf.git

commit 753ab43bcac7305a1f1a1542dc484ec6609362e1
Author: Colm O hEigeartaigh <co...@apache.org>
AuthorDate: Wed Jan 26 15:43:56 2022 +0000

    Fixed a bug in Base64Utility not passing the urlSafe parameter
    
    (cherry picked from commit cc3b622410bb67d93447e703199324a36ffd1596)
    (cherry picked from commit 93d813e9bf33bbb8121f0536c01b1fe378f84e54)
    (cherry picked from commit b93b600d14edcebe6d2a27b3455b2231485c5526)
---
 core/src/main/java/org/apache/cxf/common/util/Base64Utility.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/core/src/main/java/org/apache/cxf/common/util/Base64Utility.java b/core/src/main/java/org/apache/cxf/common/util/Base64Utility.java
index ed1a1cc..22bb96f 100644
--- a/core/src/main/java/org/apache/cxf/common/util/Base64Utility.java
+++ b/core/src/main/java/org/apache/cxf/common/util/Base64Utility.java
@@ -251,7 +251,7 @@ public final class Base64Utility {
     }
 
     public static String encode(byte[] id, boolean urlSafe) {
-        char[] cd = encodeChunk(id, 0, id.length);
+        char[] cd = encodeChunk(id, 0, id.length, urlSafe);
         return new String(cd, 0, cd.length);
     }
 

[cxf] 02/03: CXF-8646 - Don't return exception class name when parsing XML

Posted by co...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

coheigea pushed a commit to branch 3.3.x-fixes
in repository https://gitbox.apache.org/repos/asf/cxf.git

commit aee2895cbe503b593d352305b0c62e33856f1c22
Author: Colm O hEigeartaigh <co...@apache.org>
AuthorDate: Thu Jan 27 16:41:03 2022 +0000

    CXF-8646 - Don't return exception class name when parsing XML
    
    (cherry picked from commit 69cf83dfcedfd4c496459dc03433776703d60222)
    (cherry picked from commit 023a6edfa2bdfca28126a52a71c2b9677126eacf)
    (cherry picked from commit a56e51b4eef5d417ac29a14af1e7acfe797b9c21)
---
 .../cxf/databinding/source/Messages.properties     |  2 +-
 .../cxf/databinding/source/NodeDataReader.java     |  2 +-
 .../databinding/source/XMLStreamDataReader.java    |  4 +--
 .../source/XMLStreamDataReaderTest.java            | 31 +++++++++++++++++++++-
 4 files changed, 34 insertions(+), 5 deletions(-)

diff --git a/core/src/main/java/org/apache/cxf/databinding/source/Messages.properties b/core/src/main/java/org/apache/cxf/databinding/source/Messages.properties
index 5dc12a4..039a199 100644
--- a/core/src/main/java/org/apache/cxf/databinding/source/Messages.properties
+++ b/core/src/main/java/org/apache/cxf/databinding/source/Messages.properties
@@ -20,6 +20,6 @@
 #
 COULD_NOT_READ_XML_STREAM = Could not parse the XML stream.
 COULD_NOT_WRITE_XML_STREAM = Could not generate the XML stream.
-COULD_NOT_READ_XML_STREAM_CAUSED_BY = Could not parse the XML stream caused by: {0}: {1}.
+COULD_NOT_READ_XML_STREAM_CAUSED_BY = Could not parse the XML stream caused by: {0}.
 COULD_NOT_WRITE_XML_STREAM_CAUSED_BY = Could not generate the XML stream caused by: {0}: {1}.
 NO_MSV_AVAILABLE = Failed to initialize MSV validator, using slower validation routing.
diff --git a/core/src/main/java/org/apache/cxf/databinding/source/NodeDataReader.java b/core/src/main/java/org/apache/cxf/databinding/source/NodeDataReader.java
index c55f79e..85456e8 100644
--- a/core/src/main/java/org/apache/cxf/databinding/source/NodeDataReader.java
+++ b/core/src/main/java/org/apache/cxf/databinding/source/NodeDataReader.java
@@ -64,7 +64,7 @@ public class NodeDataReader implements DataReader<Node> {
                 throw new Fault("COULD_NOT_READ_XML_STREAM", LOG, e);
             } catch (XMLStreamException e) {
                 throw new Fault("COULD_NOT_READ_XML_STREAM_CAUSED_BY", LOG, e,
-                                e.getClass().getCanonicalName(), e.getMessage());
+                                e.getMessage());
             }
         }
         return read(input);
diff --git a/core/src/main/java/org/apache/cxf/databinding/source/XMLStreamDataReader.java b/core/src/main/java/org/apache/cxf/databinding/source/XMLStreamDataReader.java
index 307b46c..c9dcf15 100644
--- a/core/src/main/java/org/apache/cxf/databinding/source/XMLStreamDataReader.java
+++ b/core/src/main/java/org/apache/cxf/databinding/source/XMLStreamDataReader.java
@@ -160,7 +160,7 @@ public class XMLStreamDataReader implements DataReader<XMLStreamReader> {
             throw new Fault("COULD_NOT_READ_XML_STREAM", LOG, e);
         } catch (XMLStreamException e) {
             throw new Fault("COULD_NOT_READ_XML_STREAM_CAUSED_BY", LOG, e,
-                            e.getClass().getCanonicalName(), e.getMessage());
+                            e.getMessage());
         }
     }
 
@@ -298,7 +298,7 @@ public class XMLStreamDataReader implements DataReader<XMLStreamReader> {
             return new DOMSource(document);
         } catch (XMLStreamException e) {
             throw new Fault("COULD_NOT_READ_XML_STREAM_CAUSED_BY", LOG, e,
-                            e.getClass().getCanonicalName(), e.getMessage());
+                            e.getMessage());
         }
     }
 
diff --git a/core/src/test/java/org/apache/cxf/databinding/source/XMLStreamDataReaderTest.java b/core/src/test/java/org/apache/cxf/databinding/source/XMLStreamDataReaderTest.java
index b35956f..8d6684f 100755
--- a/core/src/test/java/org/apache/cxf/databinding/source/XMLStreamDataReaderTest.java
+++ b/core/src/test/java/org/apache/cxf/databinding/source/XMLStreamDataReaderTest.java
@@ -26,6 +26,7 @@ import java.io.InputStream;
 import javax.xml.namespace.QName;
 import javax.xml.stream.XMLStreamReader;
 
+import org.apache.cxf.interceptor.Fault;
 import org.apache.cxf.message.Message;
 import org.apache.cxf.message.MessageImpl;
 import org.apache.cxf.staxutils.StaxUtils;
@@ -40,6 +41,8 @@ import static org.junit.Assert.assertTrue;
  */
 public class XMLStreamDataReaderTest {
     private static final byte[] DUMMY_DATA = "<ns:dummy xmlns:ns='http://www.apache.org/cxf'/>".getBytes();
+    private static final byte[] DUMMY_DATA_NULL_BYTE =
+        "<ns:dummy xmlns:ns='http://www.apache.org/cxf&#x00;'/>".getBytes();
 
     @Test
     public void testCloseOriginalInputStream() throws Exception {
@@ -63,6 +66,32 @@ public class XMLStreamDataReaderTest {
         assertTrue(in1.isClosed());
     }
 
+    // Parse some XML with a null byte and check we don't return internal Woodstox package names in the error message
+    @Test
+    public void testParseNullByte() throws Exception {
+        XMLStreamDataReader reader = new XMLStreamDataReader();
+        Message msg = new MessageImpl();
+
+        TestInputStream in1 = new TestInputStream(DUMMY_DATA_NULL_BYTE);
+
+        msg.setContent(InputStream.class, in1);
+
+        reader.setProperty(Message.class.getName(), msg);
+
+        Object obj = reader.read(new QName("http://www.apache.org/cxf", "dummy"),
+                StaxUtils.createXMLStreamReader(in1), XMLStreamReader.class);
+
+        assertTrue(obj instanceof XMLStreamReader);
+
+        try {
+            reader.read((XMLStreamReader) obj);
+        } catch (Fault f) {
+            assertFalse(f.getMessage().contains("com.ctc.wstx"));
+        }
+
+        ((XMLStreamReader)obj).close();
+    }
+
     private static class TestInputStream extends ByteArrayInputStream {
         private boolean closed;
 
@@ -80,4 +109,4 @@ public class XMLStreamDataReaderTest {
             return closed;
         }
     }
-}
\ No newline at end of file
+}