Validate cuOptGetErrorString buffer size#1313
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (4)
📝 WalkthroughWalkthroughThis PR adds input validation to the ChangesError String Buffer Size Validation
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
This tightens one C API edge case and adds a small regression test for it.
What changed:
cuOptGetErrorString0and-1buffer sizesWhy:
cuOptGetParameteralready rejects<= 0output buffer sizes, butcuOptGetErrorStringwas still passing its signed size straight intosnprintf. This just makes the behavior consistent and keeps the validation on the API boundary.Testing:
git diff --checknvccor a configured cuOpt build environment, so I could not buildlibcuopt/ runC_API_TESTlocallyCloses #1311.