pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1857411 - /pdfbox/branches/issue45/pdfbox/src/main/java/org/apache/pdfbox/util/Hex.java
Date Fri, 12 Apr 2019 16:51:38 GMT
Author: tilman
Date: Fri Apr 12 16:51:38 2019
New Revision: 1857411

URL: http://svn.apache.org/viewvc?rev=1857411&view=rev
Log:
PDFBOX-4513: skip CR/LF

Modified:
    pdfbox/branches/issue45/pdfbox/src/main/java/org/apache/pdfbox/util/Hex.java

Modified: pdfbox/branches/issue45/pdfbox/src/main/java/org/apache/pdfbox/util/Hex.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/issue45/pdfbox/src/main/java/org/apache/pdfbox/util/Hex.java?rev=1857411&r1=1857410&r2=1857411&view=diff
==============================================================================
--- pdfbox/branches/issue45/pdfbox/src/main/java/org/apache/pdfbox/util/Hex.java (original)
+++ pdfbox/branches/issue45/pdfbox/src/main/java/org/apache/pdfbox/util/Hex.java Fri Apr 12
16:51:38 2019
@@ -273,6 +273,11 @@ public final class Hex
         ByteArrayOutputStream baos = new ByteArrayOutputStream();
         for (int i = 0; i < s.length() - 1; i += 2)
         {
+            if (s.charAt(i) == '\n' || s.charAt(i) == '\r')
+            {
+                --i;
+                continue;
+            }
             String hexByte = s.substring(i, i + 2);
             try
             {



Mime
View raw message