Refuse harder and print a debug warning in case some bad code

tries to write invalid lines to the config file.
Patch by DGandalf, thanks.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1962 726aef4b-f618-498e-8847-2d620e286838
This commit is contained in:
cflakes
2010-05-01 18:47:52 +00:00
parent bb567c51de
commit 837f1f62a8
2 changed files with 7 additions and 2 deletions

View File

@@ -602,8 +602,13 @@ bool CUser::DelChan(const CString& sName) {
return false;
}
bool CUser::PrintLine(CFile& File, const CString& sName, const CString& sValue) {
bool CUser::PrintLine(CFile& File, CString sName, CString sValue) {
sName.Trim();
sValue.Trim();
if (sName.empty() || sValue.empty()) {
DEBUG("Refused writing an invalid line to a user config. ["
<< sName << "] [" << sValue << "]");
return false;
}