diff --git a/dune/istl/bcrsmatrix.hh b/dune/istl/bcrsmatrix.hh
index a6cf48be75de4c89b68304f27275a1817150a6dd..9239abf1097c1b1c856dee9aafe767ba5166a076 100644
--- a/dune/istl/bcrsmatrix.hh
+++ b/dune/istl/bcrsmatrix.hh
@@ -1089,7 +1089,7 @@ namespace Dune {
      *  performs compression of index and data arrays with linear
      *  complexity
      *
-     *  An object with some statistics about the compression form
+     *  An object with some statistics about the compression for
      *  future optimization is returned.
      */
     CompressionStatistics<size_type> compress()
@@ -1136,6 +1136,9 @@ namespace Dune {
           //check whether there are elements in the overflow area which take precedence
           while ((oit!=overflow.end()) && (oit->first < std::make_pair(i,**it)))
           {
+            //check whether allocated size is reached
+            if (jiit == j.get() + allocationSize)
+              DUNE_THROW(Dune::ISTLError,"Allocated Size for BCRSMatrix was not sufficient!");
             //copy and element from the overflow area to the insertion position in a and j
             *(++jiit) = oit->first.second;
             *(++aiit) = oit->second;
@@ -1143,6 +1146,10 @@ namespace Dune {
             r[i].setsize(r[i].getsize()+1);
           }
 
+          //check whether allocated size is reached
+          if (jiit == j.get() + allocationSize)
+            DUNE_THROW(Dune::ISTLError,"Allocated Size for BCRSMatrix was not sufficient!");
+
           //copy element from array
           *(++jiit) = **it;
           B* apos = *it-j.get()+a;
@@ -1152,6 +1159,10 @@ namespace Dune {
         //copy remaining elements from the overflow area
         while ((oit!=overflow.end()) && (oit->first.first == i))
         {
+          //check whether allocated size is reached
+          if (jiit == j.get() + allocationSize)
+            DUNE_THROW(Dune::ISTLError,"Allocated Size for BCRSMatrix was not sufficient!");
+
           //copy and element from the overflow area to the insertion position in a and j
           *(++jiit) = oit->first.second;
           *(++aiit) = oit->second;