mirror of
https://github.com/aria2/aria2.git
synced 2025-04-06 05:57:36 +03:00
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:
parent
daf0c5ee73
commit
a28f19befb
3 changed files with 26 additions and 2 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue