Segfault-Inc / Multicorn

Data Access Library
https://multicorn.org/
PostgreSQL License
697 stars 145 forks source link

Failure to reinitailze null array causes core dump #256

Open rbiro opened 4 years ago

rbiro commented 4 years ago

Under some rare circumstances, it appears postgres will modify the contents of the nulls array. Multicorn assumes that's not the case and will dump core. The patch below fixes the problem.

I was not able to find where postgres was modifying the array. But I had crashes that went away with this change, came back when I removed it, and went away again when I put it back. Not 100% conclusive given the nature of the crash. But pretty close.

diff --git a/src/python.c b/src/python.c index 394236f..f63445b 100644 --- a/src/python.c +++ b/src/python.c @@ -1210,6 +1210,8 @@ pythonDictToTuple(PyObject *p_value,

    if (cinfos[cinfo_idx] == NULL)
    {