summaryrefslogtreecommitdiffstats
path: root/Modules/clinic/_ssl.c.h
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/clinic/_ssl.c.h
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/clinic/_ssl.c.h')
-rw-r--r--Modules/clinic/_ssl.c.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/Modules/clinic/_ssl.c.h b/Modules/clinic/_ssl.c.h
index 19c0f61..2940f16 100644
--- a/Modules/clinic/_ssl.c.h
+++ b/Modules/clinic/_ssl.c.h
@@ -1297,7 +1297,9 @@ _ssl_RAND_add(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
if (ptr == NULL) {
goto exit;
}
- PyBuffer_FillInfo(&view, args[0], (void *)ptr, len, 1, 0);
+ if (PyBuffer_FillInfo(&view, args[0], (void *)ptr, len, 1, PyBUF_SIMPLE) < 0) {
+ goto exit;
+ }
}
else { /* any bytes-like object */
if (PyObject_GetBuffer(args[0], &view, PyBUF_SIMPLE) != 0) {
@@ -1662,4 +1664,4 @@ exit:
#ifndef _SSL_ENUM_CRLS_METHODDEF
#define _SSL_ENUM_CRLS_METHODDEF
#endif /* !defined(_SSL_ENUM_CRLS_METHODDEF) */
-/*[clinic end generated code: output=6342ea0062ab16c7 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=fd1c3378fbba5240 input=a9049054013a1b77]*/