sqlite3: reject negative arraysize values (#7238)

This commit is contained in:
Jiseok CHOI authored and GitHub committed 2026-02-27 20:59:15 +09:00
1 parent f8d8e25de4
commit f7fe9c53cb
2 files changed
+8 -2

No files matched your search

-1
View File
@@ -1088,7 +1088,6 @@ class CursorTests(unittest.TestCase):
self.assertEqual(len(res), 2)
@unittest.expectedFailure # TODO: RUSTPYTHON arraysize validation not implemented
def test_invalid_array_size(self):
UINT32_MAX = (1 << 32) - 1
setter = functools.partial(setattr, self.cu, 'arraysize')
+8 -1
View File
@@ -1955,9 +1955,16 @@ mod _sqlite3 {
fn arraysize(&self) -> c_int {
self.arraysize.load(Ordering::Relaxed)
}
#[pygetset(setter)]
fn set_arraysize(&self, val: c_int) {
fn set_arraysize(&self, val: c_int, vm: &VirtualMachine) -> PyResult<()> {
if val < 0 {
return Err(vm.new_value_error("arraysize may not be negative"));
}
self.arraysize.store(val, Ordering::Relaxed);
Ok(())
}
fn build_row_cast_map(