From c0321ef2c516a32bb793cd94bd95de33dae1a994 Mon Sep 17 00:00:00 2001 From: Shane Harvey Date: Fri, 2 Apr 2021 10:09:27 -0700 Subject: [PATCH] PYTHON-2630 Statically initialize Py_buffer to avoid false positives in Coverity (#588) --- bson/_cbsonmodule.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bson/_cbsonmodule.c b/bson/_cbsonmodule.c index 400a51b4e..15a37cb0a 100644 --- a/bson/_cbsonmodule.c +++ b/bson/_cbsonmodule.c @@ -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;