From: Yoga Ramalingam Date: Wed, 3 Dec 2014 17:20:17 +0000 (-0500) Subject: Fix Py list length check in cpy_build_meta() X-Git-Tag: collectd-5.3.2~16^2~1 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=f0cb93348f16ee9bb3138d1ef977ebc796123c9d;p=collectd.git Fix Py list length check in cpy_build_meta() --- diff --git a/src/pyvalues.c b/src/pyvalues.c index 4f5c4ce3..137d5eb4 100644 --- a/src/pyvalues.c +++ b/src/pyvalues.c @@ -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) {