From e16e3191c3583faab8610915f9ba812f41b6e71e Mon Sep 17 00:00:00 2001 From: Benjamin Franzke Date: Thu, 3 Oct 2013 17:28:57 +0200 Subject: Add size check für array num MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Copied from idmap plugin for winbind by cifs-utils. --- cifs_idmap_sss.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cifs_idmap_sss.c b/cifs_idmap_sss.c index 3e3e0b5..7955f0c 100644 --- a/cifs_idmap_sss.c +++ b/cifs_idmap_sss.c @@ -274,6 +274,11 @@ int cifs_idmap_ids_to_sids(void *handle, const struct cifs_uxid *cuxid, debug("num ids: %zd", num); + if (num > UINT_MAX) { + ctx_set_error(ctx, "num is too large."); + return -EINVAL; + } + for (i = 0; i < num; ++i) { char *str_sid; enum sss_id_type id_type; -- cgit