]> git.saurik.com Git - wxWidgets.git/commitdiff
check that the stream is valid before using it in Load() and Save() (patch 1516432)
authorVadim Zeitlin <vadim@wxwidgets.org>
Mon, 24 Jul 2006 18:06:57 +0000 (18:06 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Mon, 24 Jul 2006 18:06:57 +0000 (18:06 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@40285 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/xml/xml.cpp

index 25ffc91ea9beb868186249494822ebb79cb81eaa..990d6aa81fb2e44650c88fd3c1824a7ea48d2223 100644 (file)
@@ -348,12 +348,16 @@ void wxXmlDocument::DoCopy(const wxXmlDocument& doc)
 bool wxXmlDocument::Load(const wxString& filename, const wxString& encoding)
 {
     wxFileInputStream stream(filename);
+    if (!stream.Ok())
+        return false;
     return Load(stream, encoding);
 }
 
 bool wxXmlDocument::Save(const wxString& filename) const
 {
     wxFileOutputStream stream(filename);
+    if (!stream.Ok())
+        return false;
     return Save(stream);
 }