Skip to content

Commit

Permalink
round-tracker: reduce integer overflow risk in multiplication (#437)
Browse files Browse the repository at this point in the history
  • Loading branch information
juliangruber authored Oct 17, 2024
1 parent 607f328 commit 63d0d3d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions api/lib/round-tracker.js
Original file line number Diff line number Diff line change
Expand Up @@ -271,8 +271,10 @@ export async function maybeCreateSparkRound (pgClient, {
LEAST(
$5,
$6::int /* previousRound.max_tasks_per_node || BASELINE_TASKS_PER_NODE */
* $7::int /* TASKS_EXECUTED_PER_ROUND */
/ $8::int /* previousRound.measurement_count || TASKS_EXECUTED_PER_ROUND */
* (
$7::int /* TASKS_EXECUTED_PER_ROUND */
/ $8::int /* previousRound.measurement_count || TASKS_EXECUTED_PER_ROUND */
)
)
)
ON CONFLICT DO NOTHING
Expand Down

0 comments on commit 63d0d3d

Please sign in to comment.