]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Assert input stream validity when reading XML. 2980/head
authorDavid Wells <wellsd2@rpi.edu>
Wed, 17 Aug 2016 17:42:35 +0000 (13:42 -0400)
committerDavid Wells <wellsd2@rpi.edu>
Wed, 17 Aug 2016 17:42:35 +0000 (13:42 -0400)
As was discovered in 2bc6f8c810, every other ParameterHandler method
that takes an input stream argument and reads from it throws an
exception if the input stream is not in a valid state.

source/base/parameter_handler.cc

index 33056d14c8f72fb3e1b29f204ab42cc99a34fa77..7d92047a2a2d20d54ad51eca7f30975c73cbad89 100644 (file)
@@ -1862,6 +1862,7 @@ namespace
 
 bool ParameterHandler::read_input_from_xml (std::istream &in)
 {
+  AssertThrow(in, ExcIO());
   // read the XML tree assuming that (as we
   // do in print_parameters(XML) it has only
   // a single top-level node called

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.