summaryrefslogtreecommitdiffstats
path: root/src/lib/idmap
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/idmap')
-rw-r--r--src/lib/idmap/sss_idmap_conv.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/lib/idmap/sss_idmap_conv.c b/src/lib/idmap/sss_idmap_conv.c
index 1d3ffb3b2..a33604226 100644
--- a/src/lib/idmap/sss_idmap_conv.c
+++ b/src/lib/idmap/sss_idmap_conv.c
@@ -263,7 +263,7 @@ enum idmap_error_code sss_idmap_sid_to_dom_sid(struct sss_idmap_ctx *ctx,
}
errno = 0;
ul = strtoul(r, &r, 10);
- if (errno != 0 || r == NULL) {
+ if (errno != 0 || r == NULL || ul > UINT32_MAX) {
err = IDMAP_SID_INVALID;
goto done;
}
@@ -301,8 +301,8 @@ enum idmap_error_code sss_idmap_sid_to_dom_sid(struct sss_idmap_ctx *ctx,
}
errno = 0;
- ul = strtol(r, &end, 10);
- if (errno != 0 || end == NULL ||
+ ul = strtoul(r, &end, 10);
+ if (errno != 0 || ul > UINT32_MAX || end == NULL ||
(*end != '\0' && *end != '-')) {
err = IDMAP_SID_INVALID;
goto done;