PYTHON-2630 Statically initialize Py_buffer to avoid false positives in Coverity (#588)

This commit is contained in:
Shane Harvey 2021-04-02 10:09:27 -07:00 committed by GitHub
parent 1882e99f77
commit c0321ef2c5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2501,7 +2501,7 @@ static PyObject* _cbson_bson_to_dict(PyObject* self, PyObject* args) {
codec_options_t options;
PyObject* result = NULL;
PyObject* options_obj;
Py_buffer view;
Py_buffer view = {0};
if (! (PyArg_ParseTuple(args, "OO", &bson, &options_obj) &&
convert_codec_options(options_obj, &options))) {
@ -2580,7 +2580,7 @@ static PyObject* _cbson_decode_all(PyObject* self, PyObject* args) {
PyObject* result = NULL;
codec_options_t options;
PyObject* options_obj;
Py_buffer view;
Py_buffer view = {0};
if (!PyArg_ParseTuple(args, "O|O", &bson, &options_obj)) {
return NULL;