Mentions légales du service

Skip to content
Snippets Groups Projects
Commit a7dd3bff authored by Mathieu Faverge's avatar Mathieu Faverge
Browse files

descriptors: Protect dist_m, dist_n against negative values

parent 3fa599bc
No related branches found
No related tags found
1 merge request!400Many small warning/bug fixes
...@@ -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;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment