From: Ivana Hutarova Varekova Date: Wed, 20 Apr 2011 13:41:49 +0000 (+0200) Subject: add missing arg test to theree api functions X-Git-Tag: v0.38~102 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a3605a5aa78ced098f174be9159eb7a4cf1dc1c3;p=thirdparty%2Flibcgroup.git 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 --- 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;