From: <ps...@us...> - 2009-03-31 09:18:16
|
Revision: 1464 http://znc.svn.sourceforge.net/znc/?rev=1464&view=rev Author: psychon Date: 2009-03-31 09:18:04 +0000 (Tue, 31 Mar 2009) Log Message: ----------- Make CUser::PrintLine() a little more readable and fix the return value Modified Paths: -------------- trunk/User.cpp Modified: trunk/User.cpp =================================================================== --- trunk/User.cpp 2009-03-31 09:07:02 UTC (rev 1463) +++ trunk/User.cpp 2009-03-31 09:18:04 UTC (rev 1464) @@ -581,8 +581,12 @@ return false; } - return File.Write("\t" + sName.FirstLine() - + " = " + sValue.FirstLine() + "\n"); + // FirstLine() so that no one can inject new lines to the config if he + // manages to add "\n" to e.g. sValue. + CString sLine = "\t" + sName.FirstLine() + " = " + sValue.FirstLine() + "\n"; + if (File.Write(sLine) <= 0) + return false; + return true; } bool CUser::WriteConfig(CFile& File) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |