2009-06-14 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>

Throw an exception if position is less than 0.
	* src/XmlRpcMethodImpl.cc
	* test/XmlRpcMethodTest.cc
This commit is contained in:
Tatsuhiro Tsujikawa 2009-06-14 11:29:46 +00:00
parent daf0c5ee73
commit a28f19befb
3 changed files with 26 additions and 2 deletions

View file

@ -102,8 +102,12 @@ static void getPosParam(const BDE& params, size_t posParamIndex,
bool& posGiven, size_t& pos)
{
if(params.size() > posParamIndex && params[posParamIndex].isInteger()) {
pos = params[posParamIndex].i();
posGiven = true;
if(params[posParamIndex].i() >= 0) {
pos = params[posParamIndex].i();
posGiven = true;
} else {
throw DL_ABORT_EX("Position must be greater than or equal to 0.");
}
} else {
posGiven = false;
}