]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Fix illegal memory access in two loops: first check the bounds of access and then...
authorkronbichler <kronbichler@0785d39b-7218-0410-832d-ea1e28bc413d>
Mon, 18 Oct 2010 14:43:50 +0000 (14:43 +0000)
committerkronbichler <kronbichler@0785d39b-7218-0410-832d-ea1e28bc413d>
Mon, 18 Oct 2010 14:43:50 +0000 (14:43 +0000)
git-svn-id: https://svn.dealii.org/trunk@22362 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/deal.II/source/dofs/dof_tools.cc

index e87e0155a20d5de81e0ac98e87c15903882bccb1..574a8044f9f7010c85f954a8e74189d02a8b22b5 100644 (file)
@@ -4325,16 +4325,14 @@ DoFTools::dof_indices_with_subdomain_association (const DH           &dof_handle
   while (index < dof_handler.n_dofs())
     {
                                       // find first_of
-      while ((subdomain_association[index] != subdomain)
-            &&
-            (index < dof_handler.n_dofs()))
+      while ((index < dof_handler.n_dofs()) &&
+            (subdomain_association[index] != subdomain))
        ++index;
       const unsigned int begin = index;
 
                                       // find first_not_of
-      while ((subdomain_association[index] == subdomain)
-            &&
-            (index < dof_handler.n_dofs()))
+      while ((index < dof_handler.n_dofs()) &&
+            (subdomain_association[index] == subdomain))
        ++index;
       const unsigned int end = index;
 

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.