chemistry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From f...@apache.org
Subject svn commit: r1777338 - /chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/impl/AbstractSessionTest.java
Date Wed, 04 Jan 2017 16:39:26 GMT
Author: fmui
Date: Wed Jan  4 16:39:26 2017
New Revision: 1777338

URL: http://svn.apache.org/viewvc?rev=1777338&view=rev
Log:
TCK: protecting the TCK from buggy servers

Modified:
    chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/impl/AbstractSessionTest.java

Modified: chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/impl/AbstractSessionTest.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/impl/AbstractSessionTest.java?rev=1777338&r1=1777337&r2=1777338&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/impl/AbstractSessionTest.java
(original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/impl/AbstractSessionTest.java
Wed Jan  4 16:39:26 2017
@@ -278,13 +278,17 @@ public abstract class AbstractSessionTes
             while (true) {
                 b = reader.read(buffer, 0, buffer.length);
                 if (b > 0) {
+                    if(sb.length() + b > 10 * 1024 * 1024) {
+                        throw new IOException("File too large!");
+                    }
+
                     sb.append(buffer, 0, b);
                 } else if (b == -1) {
                     break;
                 }
             }
         } finally {
-            reader.close();
+            IOUtils.closeQuietly(reader);
         }
 
         return sb.toString();



Mime
View raw message