fix for infinite loop in wxFileConfig when reading from input stream fails (patch 837134)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@24458 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -494,11 +494,22 @@ wxFileConfig::wxFileConfig(wxInputStream &inStream, wxMBConv& conv)
|
|||||||
wxString strTmp;
|
wxString strTmp;
|
||||||
|
|
||||||
char buf[1024];
|
char buf[1024];
|
||||||
while ( !inStream.Read(buf, WXSIZEOF(buf)).Eof() )
|
for ( ;; )
|
||||||
strTmp.append(wxConvertMB2WX(buf), inStream.LastRead());
|
{
|
||||||
|
inStream.Read(buf, WXSIZEOF(buf));
|
||||||
|
|
||||||
|
if ( !inStream.IsOk() )
|
||||||
|
{
|
||||||
|
wxLogError(_("Error reading config options."));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
strTmp.append(wxConvertMB2WX(buf), inStream.LastRead());
|
strTmp.append(wxConvertMB2WX(buf), inStream.LastRead());
|
||||||
|
|
||||||
|
if ( inStream.Eof() )
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
strTrans = wxTextBuffer::Translate(strTmp);
|
strTrans = wxTextBuffer::Translate(strTmp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user