From f4e0eae904ff94af3f6b80cbfc3175cb4b24c2cd Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Sun, 26 Feb 2012 21:49:37 +0900 Subject: Added checkRequiredInteger() to check integer param is in valid range. Ensure that fileIndex in aria2.changeUri RPC method is greater than or equal to 1. --- src/RpcMethodImpl.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/RpcMethodImpl.cc') diff --git a/src/RpcMethodImpl.cc b/src/RpcMethodImpl.cc index f351f2a9..fd190773 100644 --- a/src/RpcMethodImpl.cc +++ b/src/RpcMethodImpl.cc @@ -1392,7 +1392,7 @@ SharedHandle ChangeUriRpcMethod::process (const RpcRequest& req, DownloadEngine* e) { const String* gidParam = checkRequiredParam(req, 0); - const Integer* indexParam = checkRequiredParam(req, 1); + const Integer* indexParam = checkRequiredInteger(req, 1, IntegerGE(1)); const List* delUrisParam = checkRequiredParam(req, 2); const List* addUrisParam = checkRequiredParam(req, 3); const Integer* posParam = checkParam(req, 4); -- cgit