summaryrefslogtreecommitdiffstats
path: root/Modules/_sqlite
diff options
context:
space:
mode:
authorNikita Sobolev <mail@sobolevn.me>2024-02-05 10:45:09 (GMT)
committerGitHub <noreply@github.com>2024-02-05 10:45:09 (GMT)
commit87cd20a567aca56369010689e22a524bc1f1ac03 (patch)
treef9dda11ce92281b1da8b240154c29937fd751d9b /Modules/_sqlite
parentf71bdd34085d31a826148b2e5da57e0302655056 (diff)
downloadcpython-87cd20a567aca56369010689e22a524bc1f1ac03.zip
cpython-87cd20a567aca56369010689e22a524bc1f1ac03.tar.gz
cpython-87cd20a567aca56369010689e22a524bc1f1ac03.tar.bz2
gh-115026: Argument Clinic: handle PyBuffer_FillInfo errors in generated code (#115027)
Diffstat (limited to 'Modules/_sqlite')
-rw-r--r--Modules/_sqlite/clinic/connection.c.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/Modules/_sqlite/clinic/connection.c.h b/Modules/_sqlite/clinic/connection.c.h
index db5eb77..f2cff6a 100644
--- a/Modules/_sqlite/clinic/connection.c.h
+++ b/Modules/_sqlite/clinic/connection.c.h
@@ -1551,7 +1551,9 @@ deserialize(pysqlite_Connection *self, PyObject *const *args, Py_ssize_t nargs,
if (ptr == NULL) {
goto exit;
}
- PyBuffer_FillInfo(&data, args[0], (void *)ptr, len, 1, 0);
+ if (PyBuffer_FillInfo(&data, args[0], (void *)ptr, len, 1, PyBUF_SIMPLE) < 0) {
+ goto exit;
+ }
}
else { /* any bytes-like object */
if (PyObject_GetBuffer(args[0], &data, PyBUF_SIMPLE) != 0) {
@@ -1818,4 +1820,4 @@ exit:
#ifndef DESERIALIZE_METHODDEF
#define DESERIALIZE_METHODDEF
#endif /* !defined(DESERIALIZE_METHODDEF) */
-/*[clinic end generated code: output=90b5b9c14261b8d7 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=99299d3ee2c247ab input=a9049054013a1b77]*/