Commit 70ab15e3 authored by D-AIRY's avatar D-AIRY

Fixed potentially crash in config writer

parent 3283d180
......@@ -605,7 +605,7 @@ int CConfig::writeFile(const CConfigString & name, CConfigString section, CConfi
break;
}
}
while(szData[i] == '\r' || szData[i] == '\n')
while(i < fl && (szData[i] == '\r' || szData[i] == '\n'))
{
++i;
}
......@@ -620,7 +620,7 @@ int CConfig::writeFile(const CConfigString & name, CConfigString section, CConfi
se = true;
break;
}
while((szData[i] == ' ' || szData[i] == '\t') && i < fl)
while(i < fl && (szData[i] == ' ' || szData[i] == '\t'))
{
++i;
}
......@@ -674,7 +674,7 @@ int CConfig::writeFile(const CConfigString & name, CConfigString section, CConfi
break;
}
}
while(szData[i] == '\r' || szData[i] == '\n')
while(i < fl && (szData[i] == '\r' || szData[i] == '\n'))
{
++i;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment