You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(cmd): reject NaN and Inf Savings Plan hourly commitments at validation #2213
validateSavingsPlanPreconditions (cmd/savings_plan_purchase.go) rejects HourlyCommitment <= 0 and, after #2209, values that format to 0.00. NaN and ±Inf pass both checks: NaN <= 0 is false, and %.2f renders them as NaN / +Inf. They then reach the AWS provider, which sends fmt.Sprintf("%.2f", ...) as the commitment string.
Reachable through a CSV cell containing NaN/Inf or a bad upstream recommendation value. AWS would most likely reject the request, but the CLI should fail at its own boundary with a clear error.
Suggested fix: guard with !(x > 0) || math.IsInf(x, 0) and add table cases for NaN, +Inf and -Inf.
Found during the independent review of #2209 (out of scope there; pre-existing behaviour).
Activity