pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1857408 - /pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/Hex.java
Date Fri, 12 Apr 2019 16:25:39 GMT
Author: tilman
Date: Fri Apr 12 16:25:39 2019
New Revision: 1857408

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

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

Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/Hex.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/Hex.java?rev=1857408&r1=1857407&r2=1857408&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/Hex.java (original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/Hex.java Fri Apr 12 16:25:39
2019
@@ -232,6 +232,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