Guard against NULL outbind entry in DO statement parameter setup - #1619
Guard against NULL outbind entry in DO statement parameter setup#1619Aias00 wants to merge 1 commit into
Conversation
When outbind positions are not contiguous, the inner lookup loop ends with info == NULL and the subsequent info->dtype dereference crashes the client. Report an error and clean up instead. Closes IvorySQL#1617
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthrough
ChangesOUT-bind validation
Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: ⚪ Minimal · up to This localized fix prevents a client crash when DO-statement parameter positions are non-contiguous and returns an error instead; no actionable merge-blocking risk remains after normal checks and review. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
Summary
Fixes #1617: in the DO-statement parameter setup of
IvyStmtExecute(src/interfaces/libpq/ivy-exec.c), the inner loop searchesoutbindforinfo->position == i + 1and then dereferencesinfounconditionally. If the caller bound non-contiguous positions (e.g. 1 and 3, skipping 2),infois NULL andinfo->dtypecrashes the client process.The fix reports "outbind position not found" and cleans up (
paramTypes+query_buf) before returning 0, matching the error style of the same function.Test plan
make -C src/interfaces/libpq ivy-exec.ocompiles cleanly.Summary by CodeRabbit