diff options
author | Benjamin Franzke <benjaminfranzke@googlemail.com> | 2013-10-03 17:28:57 +0200 |
---|---|---|
committer | Benjamin Franzke <benjaminfranzke@googlemail.com> | 2013-10-03 17:28:57 +0200 |
commit | e16e3191c3583faab8610915f9ba812f41b6e71e (patch) | |
tree | 6fe44f418b1e014943e74f35fc7258911c2f41be | |
parent | 5f721fbf527d0d08b5387d6e4d761f410f83de4b (diff) | |
download | cifs_idmap_sss-e16e3191c3583faab8610915f9ba812f41b6e71e.tar.gz cifs_idmap_sss-e16e3191c3583faab8610915f9ba812f41b6e71e.tar.bz2 cifs_idmap_sss-e16e3191c3583faab8610915f9ba812f41b6e71e.zip |
Add size check für array num
Copied from idmap plugin for winbind by cifs-utils.
-rw-r--r-- | cifs_idmap_sss.c | 5 |
1 files changed, 5 insertions, 0 deletions
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; |