Code

Fix Py list length check in cpy_build_meta()
authorYoga Ramalingam <yramalingam1@bloomberg.net>
Wed, 3 Dec 2014 17:20:17 +0000 (12:20 -0500)
committerYoga Ramalingam <yramalingam1@bloomberg.net>
Wed, 3 Dec 2014 17:20:17 +0000 (12:20 -0500)
src/pyvalues.c

index 4f5c4ce3ac41eb46f3172e5d8b0cee89a5d50b37..137d5eb4421f3c8ff142cb5dfec2c2204a28c8b7 100644 (file)
@@ -427,10 +427,9 @@ static meta_data_t *cpy_build_meta(PyObject *meta) {
                cpy_log_exception("building meta data");
                return NULL;
        }
-
        s = PyList_Size(l);
-       if (s < 0)
-               return NULL;
+    if (s <= 0)
+        return NULL;
 
        m = meta_data_create();
        for (i = 0; i < s; ++i) {