summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cifs_idmap_sss.c5
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;