Restrict task complexity to a specific range to avoid integer overflow

This commit is contained in:
Frederic Guillot
2016-10-08 09:58:11 -04:00
parent 1466afb771
commit c2f1cc8f74
37 changed files with 179 additions and 132 deletions

View File

@@ -1276,4 +1276,5 @@ return array(
// 'Duplicate to multiple projects' => '',
// 'This field is required' => '',
// 'Moving a task is not permitted' => '',
// 'This value must be in the range %d to %d' => '',
);

View File

@@ -1276,4 +1276,5 @@ return array(
// 'Duplicate to multiple projects' => '',
// 'This field is required' => '',
// 'Moving a task is not permitted' => '',
// 'This value must be in the range %d to %d' => '',
);

View File

@@ -1276,4 +1276,5 @@ return array(
// 'Duplicate to multiple projects' => '',
// 'This field is required' => '',
// 'Moving a task is not permitted' => '',
// 'This value must be in the range %d to %d' => '',
);

View File

@@ -1276,4 +1276,5 @@ return array(
// 'Duplicate to multiple projects' => '',
// 'This field is required' => '',
// 'Moving a task is not permitted' => '',
// 'This value must be in the range %d to %d' => '',
);

View File

@@ -1276,4 +1276,5 @@ return array(
// 'Duplicate to multiple projects' => '',
// 'This field is required' => '',
// 'Moving a task is not permitted' => '',
// 'This value must be in the range %d to %d' => '',
);

View File

@@ -1276,4 +1276,5 @@ return array(
// 'Duplicate to multiple projects' => '',
// 'This field is required' => '',
// 'Moving a task is not permitted' => '',
// 'This value must be in the range %d to %d' => '',
);

View File

@@ -1276,4 +1276,5 @@ return array(
// 'Duplicate to multiple projects' => '',
// 'This field is required' => '',
// 'Moving a task is not permitted' => '',
// 'This value must be in the range %d to %d' => '',
);

View File

@@ -1277,4 +1277,5 @@ return array(
'Duplicate to multiple projects' => 'Dupliquer vers plusieurs projets',
'This field is required' => 'Ce champ est requis',
'Moving a task is not permitted' => 'Déplaçer une tâche n\'est pas autorisé',
'This value must be in the range %d to %d' => 'Cette valeur doit être définie entre %d et %d',
);

View File

@@ -1276,4 +1276,5 @@ return array(
// 'Duplicate to multiple projects' => '',
// 'This field is required' => '',
// 'Moving a task is not permitted' => '',
// 'This value must be in the range %d to %d' => '',
);

View File

@@ -1276,4 +1276,5 @@ return array(
// 'Duplicate to multiple projects' => '',
// 'This field is required' => '',
// 'Moving a task is not permitted' => '',
// 'This value must be in the range %d to %d' => '',
);

View File

@@ -1276,4 +1276,5 @@ return array(
// 'Duplicate to multiple projects' => '',
// 'This field is required' => '',
// 'Moving a task is not permitted' => '',
// 'This value must be in the range %d to %d' => '',
);

View File

@@ -1276,4 +1276,5 @@ return array(
// 'Duplicate to multiple projects' => '',
// 'This field is required' => '',
// 'Moving a task is not permitted' => '',
// 'This value must be in the range %d to %d' => '',
);

View File

@@ -1276,4 +1276,5 @@ return array(
// 'Duplicate to multiple projects' => '',
// 'This field is required' => '',
// 'Moving a task is not permitted' => '',
// 'This value must be in the range %d to %d' => '',
);

View File

@@ -1276,4 +1276,5 @@ return array(
// 'Duplicate to multiple projects' => '',
// 'This field is required' => '',
// 'Moving a task is not permitted' => '',
// 'This value must be in the range %d to %d' => '',
);

View File

@@ -1276,4 +1276,5 @@ return array(
// 'Duplicate to multiple projects' => '',
// 'This field is required' => '',
// 'Moving a task is not permitted' => '',
// 'This value must be in the range %d to %d' => '',
);

View File

@@ -1276,4 +1276,5 @@ return array(
// 'Duplicate to multiple projects' => '',
// 'This field is required' => '',
// 'Moving a task is not permitted' => '',
// 'This value must be in the range %d to %d' => '',
);

View File

@@ -1276,4 +1276,5 @@ return array(
// 'Duplicate to multiple projects' => '',
// 'This field is required' => '',
// 'Moving a task is not permitted' => '',
// 'This value must be in the range %d to %d' => '',
);

View File

@@ -1276,4 +1276,5 @@ return array(
// 'Duplicate to multiple projects' => '',
// 'This field is required' => '',
// 'Moving a task is not permitted' => '',
// 'This value must be in the range %d to %d' => '',
);

View File

@@ -1276,4 +1276,5 @@ return array(
'Duplicate to multiple projects' => 'Duplicar para vários projetos',
'This field is required' => 'Este campo é obrigatório',
// 'Moving a task is not permitted' => '',
// 'This value must be in the range %d to %d' => '',
);

View File

@@ -1276,4 +1276,5 @@ return array(
// 'Duplicate to multiple projects' => '',
// 'This field is required' => '',
// 'Moving a task is not permitted' => '',
// 'This value must be in the range %d to %d' => '',
);

View File

@@ -1276,4 +1276,5 @@ return array(
// 'Duplicate to multiple projects' => '',
// 'This field is required' => '',
// 'Moving a task is not permitted' => '',
// 'This value must be in the range %d to %d' => '',
);

View File

@@ -1276,4 +1276,5 @@ return array(
// 'Duplicate to multiple projects' => '',
// 'This field is required' => '',
// 'Moving a task is not permitted' => '',
// 'This value must be in the range %d to %d' => '',
);

View File

@@ -1276,4 +1276,5 @@ return array(
// 'Duplicate to multiple projects' => '',
// 'This field is required' => '',
// 'Moving a task is not permitted' => '',
// 'This value must be in the range %d to %d' => '',
);

View File

@@ -1276,4 +1276,5 @@ return array(
// 'Duplicate to multiple projects' => '',
// 'This field is required' => '',
// 'Moving a task is not permitted' => '',
// 'This value must be in the range %d to %d' => '',
);

View File

@@ -1276,4 +1276,5 @@ return array(
// 'Duplicate to multiple projects' => '',
// 'This field is required' => '',
// 'Moving a task is not permitted' => '',
// 'This value must be in the range %d to %d' => '',
);

View File

@@ -28,6 +28,7 @@ class TaskValidator extends BaseValidator
new Validators\Integer('owner_id', t('This value must be an integer')),
new Validators\Integer('creator_id', t('This value must be an integer')),
new Validators\Integer('score', t('This value must be an integer')),
new Validators\Range('score', t('This value must be in the range %d to %d', -2147483647, 2147483647), -2147483647, 2147483647),
new Validators\Integer('category_id', t('This value must be an integer')),
new Validators\Integer('swimlane_id', t('This value must be an integer')),
new Validators\Integer('recurrence_child', t('This value must be an integer')),
@@ -95,27 +96,6 @@ class TaskValidator extends BaseValidator
);
}
/**
* Validate description creation
*
* @access public
* @param array $values Form values
* @return array $valid, $errors [0] = Success or not, [1] = List of errors
*/
public function validateDescriptionCreation(array $values)
{
$rules = array(
new Validators\Required('id', t('The id is required')),
);
$v = new Validator($values, array_merge($rules, $this->commonValidationRules()));
return array(
$v->execute(),
$v->getErrors()
);
}
/**
* Validate edit recurrence
*