BIND 10 trac1217, updated. f2ffe07f7e25c037855685b7693ea4d4eed1cd0c [1217] explicitely check return value of PyObject_Not()

BIND 10 source code commits bind10-changes at lists.isc.org
Thu Nov 3 20:48:16 UTC 2011


The branch, trac1217 has been updated
       via  f2ffe07f7e25c037855685b7693ea4d4eed1cd0c (commit)
      from  c5f69488232bd0464cd7e2174be96b30b51b7e83 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit f2ffe07f7e25c037855685b7693ea4d4eed1cd0c
Author: Jelte Jansen <jelte at isc.org>
Date:   Thu Nov 3 21:47:59 2011 +0100

    [1217] explicitely check return value of PyObject_Not()

-----------------------------------------------------------------------

Summary of changes:
 src/lib/python/isc/datasrc/client_python.cc |   14 +++++++++++---
 1 files changed, 11 insertions(+), 3 deletions(-)

-----------------------------------------------------------------------
diff --git a/src/lib/python/isc/datasrc/client_python.cc b/src/lib/python/isc/datasrc/client_python.cc
index 8613d84..49235a6 100644
--- a/src/lib/python/isc/datasrc/client_python.cc
+++ b/src/lib/python/isc/datasrc/client_python.cc
@@ -89,9 +89,17 @@ DataSourceClient_getIterator(PyObject* po_self, PyObject* args) {
                          &adjust_ttl_obj)) {
         try {
             bool adjust_ttl = true;
-            if (adjust_ttl_obj != NULL &&
-                PyObject_Not(adjust_ttl_obj)) {
-                adjust_ttl = false;
+            if (adjust_ttl_obj != NULL) {
+                // store result in local var so we can explicitely check for
+                // -1 error return value
+                int adjust_ttl_no = PyObject_Not(adjust_ttl_obj);
+                if (adjust_ttl_no == 1) {
+                    adjust_ttl = false;
+                } else if (adjust_ttl_no == -1) {
+                    PyErr_SetString(getDataSourceException("Error"),
+                                    "Error getting value of adjust_ttl");
+                    return (NULL);
+                }
             }
             return (createZoneIteratorObject(
                 self->cppobj->getInstance().getIterator(PyName_ToName(name_obj),




More information about the bind10-changes mailing list