From e3ba21039cce93a37edbdb1c14b00337985d4242 Mon Sep 17 00:00:00 2001 From: Gabriel Kihlman Date: Mon, 18 Apr 2016 17:28:50 +0200 Subject: [PATCH 1/2] Avoid a possible null deref, tz might be NULL. Found by clang static analyzer. --- psycopg/adapter_datetime.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/psycopg/adapter_datetime.c b/psycopg/adapter_datetime.c index 0571837d..9d04df40 100644 --- a/psycopg/adapter_datetime.c +++ b/psycopg/adapter_datetime.c @@ -451,7 +451,7 @@ psyco_TimestampFromTicks(PyObject *self, PyObject *args) tz); exit: - Py_DECREF(tz); + Py_XDECREF(tz); Py_XDECREF(m); return res; } From 230d9d6b1ab12e3682898518f3bba4f51376e812 Mon Sep 17 00:00:00 2001 From: Daniele Varrazzo Date: Fri, 1 Jul 2016 19:27:31 +0100 Subject: [PATCH 2/2] Mention closing bug #424 in the news --- NEWS | 1 + 1 file changed, 1 insertion(+) diff --git a/NEWS b/NEWS index da8e53f7..b9715f8b 100644 --- a/NEWS +++ b/NEWS @@ -18,6 +18,7 @@ What's new in psycopg 2.6.2 - Fix build on Windows with Python 3.5, VS 2015 (:ticket:`#380`). - Fixed `!errorcodes.lookup` initialization thread-safety (:ticket:`#382`). - Fixed `!read()` exception propagation in copy_from (:ticket:`#412`). +- Fixed possible NULL TZ decref (:ticket:`#424`). What's new in psycopg 2.6.1