Mentions légales du service
Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Chameleon
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Operate
Environments
Terraform modules
Monitor
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
solverstack
Chameleon
Commits
a7dd3bff
Commit
a7dd3bff
authored
1 year ago
by
Mathieu Faverge
Browse files
Options
Downloads
Patches
Plain Diff
descriptors: Protect dist_m, dist_n against negative values
parent
3fa599bc
No related branches found
No related tags found
1 merge request
!400
Many small warning/bug fixes
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
control/descriptor_helpers.c
+9
-0
9 additions, 0 deletions
control/descriptor_helpers.c
with
9 additions
and
0 deletions
control/descriptor_helpers.c
+
9
−
0
View file @
a7dd3bff
...
@@ -139,6 +139,15 @@ int chameleon_getrankof_custom_init( custom_dist_t **custom_dist,
...
@@ -139,6 +139,15 @@ int chameleon_getrankof_custom_init( custom_dist_t **custom_dist,
return
CHAMELEON_ERR_ILLEGAL_VALUE
;
return
CHAMELEON_ERR_ILLEGAL_VALUE
;
}
}
if
(
(
dist_m
<=
0
)
||
(
dist_n
<=
0
)
)
{
char
message
[
300
];
snprintf
(
message
,
300
,
"Incorrect values for dist_m(%d) and/or dist_n(%d)"
,
dist_m
,
dist_n
);
chameleon_error
(
"chameleon_getrankof_custom_init"
,
message
);
free
(
result
);
fclose
(
f
);
return
CHAMELEON_ERR_ILLEGAL_VALUE
;
}
result
->
dist_m
=
dist_m
;
result
->
dist_m
=
dist_m
;
result
->
dist_n
=
dist_n
;
result
->
dist_n
=
dist_n
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment