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 (3)
✅ Files skipped from review due to trivial changes (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughThis PR adds input validation to the ChangesError String Buffer Size Validation
🎯 1 (Trivial) | ⏱️ ~3 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)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 Infer (1.2.0)cpp/src/pdlp/cuopt_c.cppcpp/src/pdlp/cuopt_c.cpp:8:10: fatal error: 'cuopt/linear_programming/cuopt_c.h' file not found ... [truncated 2200 characters] ... ClangFrontend__CTrans.CTrans_funct.instruction_insert_cxx_temporary_markers in file "src/clang/cTrans.ml", line 4866, characters 22-60 cpp/tests/linear_programming/c_api_tests/c_api_tests.cppIn file included from cpp/tests/linear_programming/c_api_tests/c_api_tests.cpp:8: ... [truncated 2200 characters] ... file "src/istd/IExn.ml" (inlined), line 18, characters 15-63 Comment |
|
🔔 Hi @anandhkb, this pull request has had no activity for 7 days. Please update or let us know if it can be closed. Thank you! If this is an "epic" issue, then please add the "epic" label to this issue. |
|
/ok to test bd69111 |
3693d85 to
86268f2
Compare
Signed-off-by: Minh Vu <vuhoangminh97@gmail.com>
86268f2 to
f42ac18
Compare
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.