Skip to content

Fix for possible OOB writes when a user builds a large query. - #337

Merged
mksanger merged 1 commit into
wtsi-npg:develfrom
kjsanger:bug/genquery-oob
May 15, 2026
Merged

Fix for possible OOB writes when a user builds a large query.#337
mksanger merged 1 commit into
wtsi-npg:develfrom
kjsanger:bug/genquery-oob

Conversation

@kjsanger

Copy link
Copy Markdown
Member

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.

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.
@kjsanger kjsanger added the bug label May 14, 2026
@kjsanger kjsanger changed the title Fix for possible OOB writes when a user build a large query. Fix for possible OOB writes when a user builds a large query. May 15, 2026
@mksanger
mksanger merged commit 3df68bb into wtsi-npg:devel May 15, 2026
3 checks passed
@kjsanger
kjsanger deleted the bug/genquery-oob branch May 18, 2026 13:48
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants