]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
- review fixes for python module.
authorWouter Wijngaards <wouter@nlnetlabs.nl>
Thu, 22 Nov 2018 13:31:21 +0000 (13:31 +0000)
committerWouter Wijngaards <wouter@nlnetlabs.nl>
Thu, 22 Nov 2018 13:31:21 +0000 (13:31 +0000)
git-svn-id: file:///svn/unbound/trunk@4969 be551aaa-1e26-0410-a405-d3ace91eadb9

doc/Changelog
pythonmod/interface.i
pythonmod/pythonmod.c

index 0000db56fb17da42bc8a3d9291d2fba43e76c600..265a34797f8a7969f5b87d96b81766b53f8c7a9a 100644 (file)
@@ -4,6 +4,7 @@
          succeed for the python module.
        - pythonmod logs the python error and traceback on failure.
        - ignore debug python module for test in doxygen output.
+       - review fixes for python module.
 
 21 November 2018: Wouter
        - Scrub NS records from NODATA responses as well.
index b5b0c5b67f9473fb7cba3e9a8dde9f81d29566c2..5f2559bacffa80e3c78033fac5cbef696a56326a 100644 (file)
@@ -53,7 +53,8 @@
      i = 0; cnt = 0;
      while (i < len) {
         char buf[LDNS_MAX_LABELLEN+1];
-        if(((unsigned int)name[i])+1 <= (unsigned int)sizeof(buf)) {
+        if(((unsigned int)name[i])+1 <= (unsigned int)sizeof(buf) &&
+                i+(int)((unsigned int)name[i]) < len) {
                 memmove(buf, name + i + 1, (unsigned int)name[i]);
                 buf[(unsigned int)name[i]] = 0;
                 PyList_SetItem(list, cnt, PyString_FromString(buf));
index 1e3d30b911165c626543f87367b88d02c1c84658..a17d977e997b026f911e1ebd1c23d4c5388fb899 100644 (file)
@@ -139,7 +139,7 @@ log_py_err(void)
                modStringIO = PyImport_ImportModule("io");
        if (modStringIO==NULL) {
                log_err("pythonmod: cannot print exception, "
-                       "cannot ImportModule cStringIO or StringIO");
+                       "cannot ImportModule cStringIO or StringIO or io");
                goto cleanup;
        }
        modTB = PyImport_ImportModule("traceback");
@@ -159,7 +159,7 @@ log_py_err(void)
        obStringIO = PyObject_CallObject(obFuncStringIO, NULL);
        if (obStringIO==NULL) {
                log_err("pythonmod: cannot print exception, "
-                       "cannot cStringIO.StringIO()");
+                       "cannot call cStringIO.StringIO()");
                goto cleanup;
        }
 
@@ -206,7 +206,8 @@ log_py_err(void)
        /* And it should be a string all ready to go - duplicate it. */
        if (!PyString_Check(obResult) && !PyUnicode_Check(obResult)) {
                log_err("pythonmod: cannot print exception, "
-                       "cStringIO.getvalue() result did not String_Check");
+                       "cStringIO.getvalue() result did not String_Check"
+                       " or Unicode_Check");
                goto cleanup;
        }
        if(PyString_Check(obResult)) {