Skip to content

Commit 9c278bb

Browse files
davidsmfreireclaude
andcommitted
fix(deps): bump pyo3 to 0.28 to clear RUSTSEC-2025-0020
pyo3 0.19.2 has a buffer-overflow advisory in `PyString::from_object` (fixed in 0.24.1). Bump to 0.28 and migrate the `#[pymodule]` entry point to the `Bound<'_, PyModule>` API introduced in 0.21. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent e5baa04 commit 9c278bb

3 files changed

Lines changed: 51 additions & 79 deletions

File tree

Cargo.lock

Lines changed: 48 additions & 76 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

sqlshield-py/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,5 @@ crate-type = ["cdylib"]
1919

2020

2121
[dependencies]
22-
pyo3 = "0.19.0"
22+
pyo3 = "0.28"
2323
sqlshield = { workspace = true }

sqlshield-py/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ fn validate_query(query: &str, schema: &str) -> PyResult<Vec<String>> {
4444

4545
/// A Python module implemented in Rust.
4646
#[pymodule]
47-
fn sqlshield(_py: Python, m: &PyModule) -> PyResult<()> {
48-
m.add_class::<PySqlValidationError>().unwrap();
47+
fn sqlshield(m: &Bound<'_, PyModule>) -> PyResult<()> {
48+
m.add_class::<PySqlValidationError>()?;
4949
m.add_function(wrap_pyfunction!(validate_files, m)?)?;
5050
m.add_function(wrap_pyfunction!(validate_query, m)?)?;
5151
Ok(())

0 commit comments

Comments
 (0)