Fix for possible OOB writes when a user builds a large query. - #337
Merged
Conversation
Add a bounds check for the maximum permitted number of query parameters. Add a test for exceeding the maximum. Add some initialisation for variables potentially uninitialised. Add free() on some error paths to avoid memory leaks. Removed some unused variables and checks.
jmtcsngr
added a commit
to jmtcsngr/baton-rs
that referenced
this pull request
Jul 23, 2026
…ery bounds check) Closes the two gaps found against the 6.1.0 re-pin instead of just claiming it: - #100: shim_query_add_where/add_select now reject once the query's condition/select list reaches iRODS's MAX_NUM_CONDITIONS, instead of writing past the fixed-size sqlCondInp/selectInp arrays -- the same OOB-write class upstream baton patched in 6.0.1 (wtsi-npg/baton#337, #338). Reachable from unbounded caller-supplied JSON via metaquery's timestamps/access arrays. add_select gained a Result return (25 call sites updated); new integration test drives 2000 access entries and asserts a clean in-band error. - #101: added SHIM_COL_DATA_PATH -> COL_D_DATA_PATH through the usual shim declare/implement/mirror path, Replicate.physical_path, and wired it into fetch_replicates. Extended the --replicate integration test and the Replicate round-trip unit test. Bumped the partisan pin (58b56da -> 1356610d2a, devel HEAD) to pick up partisan PR #349's test_replicas assertion, which requires physical_path whenever client_version() >= 6.1.0 -- the thing this work needed exercised in CI. Extendo's pin is untouched; it has no physical_path work yet.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add a bounds check for the maximum permitted number of query parameters.
Add a test for exceeding the maximum.
Add some initialisation for variables potentially uninitialised.
Add free() on some error paths to avoid memory leaks.
Removed some unused variables and checks.