]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Avoid accessing element past the end.
authorbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Mon, 4 Jul 2011 16:32:09 +0000 (16:32 +0000)
committerbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Mon, 4 Jul 2011 16:32:09 +0000 (16:32 +0000)
git-svn-id: https://svn.dealii.org/trunk@23916 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/source/dofs/dof_handler_policy.cc

index 16e916d3031d925e75c870d707fcde4c29ce63b3..2473219c1ce6f1b725113f186541bdbca667be53 100644 (file)
@@ -622,7 +622,7 @@ namespace internal
                                dofs.size() * sizeof(unsigned int));
                    ptr += dofs.size() * sizeof(unsigned int);
 
-                   Assert (ptr == &buffer[buffer.size()],
+                   Assert (ptr == &buffer[0]+buffer.size(),
                            ExcInternalError());
 
                  }
@@ -1502,7 +1502,7 @@ namespace internal
          number_cache.locally_owned_dofs.block_write(oss);
          std::string oss_str=oss.str();
          std::vector<char> my_data(oss_str.begin(), oss_str.end());
-         unsigned int my_size = my_data.size();
+         unsigned int my_size = oss_str.size();
 
                                           // determine maximum size of IndexSet
          unsigned int max_size;

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.