From a3605a5aa78ced098f174be9159eb7a4cf1dc1c3 Mon Sep 17 00:00:00 2001 From: Ivana Hutarova Varekova Date: Wed, 20 Apr 2011 15:41:49 +0200 Subject: [PATCH] add missing arg test to theree api functions add missing arg test to theree api functions Signed-off-by: Ivana Hutarova Varekova Signed-off-by: Jan Safranek --- src/api.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/api.c b/src/api.c index 2905fed8..53c76e89 100644 --- a/src/api.c +++ b/src/api.c @@ -3650,6 +3650,9 @@ int cgroup_get_subsys_mount_point(const char *controller, char **mount_point) if (!cgroup_initialized) return ECGROUPNOTINITIALIZED; + if (!controller) + return ECGINVAL; + pthread_rwlock_rdlock(&cg_mount_table_lock); for (i = 0; cg_mount_table[i].name[0] != '\0'; i++) { if (strncmp(cg_mount_table[i].name, controller, FILENAME_MAX)) @@ -3913,6 +3916,10 @@ int cgroup_dictionary_iterator_next(void **handle, return ECGINVAL; iter = *handle; + + if (!iter) + return ECGINVAL; + if (!iter->item) return ECGEOF; -- 2.47.2