From: Florian Forster Date: Mon, 20 Nov 2006 17:15:39 +0000 (+0100) Subject: src/utils_ignorelist.c: Allow the `entry' argument to be NULL/empty. X-Git-Tag: collectd-3.11.0~50 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=d5b0c6e1a85377658d8e2b35f07343cda106211f;p=collectd.git src/utils_ignorelist.c: Allow the `entry' argument to be NULL/empty. Also assert the object to be non-empty. --- diff --git a/src/utils_ignorelist.c b/src/utils_ignorelist.c index 31a3e665..27eb987c 100644 --- a/src/utils_ignorelist.c +++ b/src/utils_ignorelist.c @@ -333,10 +333,15 @@ int ignorelist_match (ignorelist_t *il, const char *entry) { ignorelist_item_t *traverse; + assert (il != NULL); + /* if no entries, collect all */ if (il->head == NULL) return (0); + if ((entry == NULL) || (strlen (entry) == 0)) + return (0); + /* traverse list and check entries */ for (traverse = il->head; traverse != NULL; traverse = traverse->next) {