]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Avoid a buffer overflow.
authorWolfgang Bangerth <bangerth@math.tamu.edu>
Mon, 13 Jul 2009 12:25:20 +0000 (12:25 +0000)
committerWolfgang Bangerth <bangerth@math.tamu.edu>
Mon, 13 Jul 2009 12:25:20 +0000 (12:25 +0000)
git-svn-id: https://svn.dealii.org/trunk@19065 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/contrib/mesh_conversion/MeshConversion.cc

index eb7d2f2fac6cb128b3be0081d1aab4c85b390243..3f018e77e44de096d5715da5e1fc1727971abbd8 100755 (executable)
@@ -166,7 +166,9 @@ bool MeshConversion::read_in_abaqus_inp (const std::string filename)
                                for (int ll = 0; ll < material_id_temp.length(); ++ll)
                                        material_id += (material_id_temp[material_id_temp.length() - ll - 1] - 48 /* ASCII TRICKS */) * pow(10.0,ll);
                                
-                               while (from_string<float> (temp_float, temp_data[k + 3 + j*(data_per_cell)], std::dec) == true)
+                               while ((k + 3 + j*(data_per_cell) < temp_data.size())
+                                      &&
+                                      (from_string<float> (temp_float, temp_data[k + 3 + j*(data_per_cell)], std::dec) == true))
                                {
                                        // Initilise storage variables
                                        std::vector <double> cell (data_per_cell);

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.