Repository navigation
fix: reject NaN and Inf in ValidateNumericParam - #1494
DsThakurRawat wants to merge 2 commits into
Conversation
strconv.ParseFloat accepts NaN, Inf and overflow values without error, so report-problem location params passed validation and were stored verbatim. Reuse the existing isFinite helper from OneBusAway#1490 to drop them like unparseable input. Fixes OneBusAway#1492 Signed-off-by: Divyansh Rawat <divyanshrawatofficial@gmail.com>
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. Important Review skippedReview was skipped as selected files did not have any reviewable changes. ⚙️ Run configurationConfiguration used: Repository UI Review profile: ASSERTIVE Plan: Advanced Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: ASSERTIVE Plan: Advanced Run ID: 📒 Files selected for processing (2)
Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review. 📝 WalkthroughWalkthrough
ChangesNumeric parameter validation
Priority: ⬇️ Low Estimated code review effort: 2 (Simple) | ~8 minutes Change: Bug fix · Severity of issue fixed: Low Suggested reviewers: Merge Risk: ⚪ Minimal · up to Non-finite report values are treated as absent optional fields, consistent with the documented inputs. No merge-blocking issue remains. Security Architecture ReviewSecurity architecture risk: 🔵 Low · up to The change narrows which location values can be stored and does not appear to change access or submission behavior. The assessment is limited by incomplete coverage of other potential callers. Retained concerns Security review detailsSecurity Blast Radius
Trust Boundaries and Controls
Resilience and Maintainability Implications
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
|
Thanks @DsThakurRawat, LGTM. This does what #1492 asks. One thing for whoever merges: #1499 later moved the policy for these params to a 400 through |



Rejects
NaN,±Infand overflow values inValidateNumericParam, so report-problem location params with non-finite values are dropped like unparseable ones instead of being stored verbatim. Reuses the existingisFinitehelper from #1490.Verified: new table cases fail on main and pass with the fix; full
internal/utilssuite andgo vetclean.Fixes #1492
Summary by CodeRabbit