summaryrefslogtreecommitdiffstats
path: root/src/lib
diff options
context:
space:
mode:
authorSumit Bose <sbose@redhat.com>2012-06-01 13:08:04 +0200
committerJan Zeleny <jzeleny@redhat.com>2012-06-08 14:42:09 +0200
commit2d07aa724c93bbaec2cd29470941c0754c74f715 (patch)
treea7bdafe74023d4f472e126fab25ba1108cbaa579 /src/lib
parent2998435fcc95857b73049b3955af9889ab595f24 (diff)
downloadsssd_unused-2d07aa724c93bbaec2cd29470941c0754c74f715.tar.gz
sssd_unused-2d07aa724c93bbaec2cd29470941c0754c74f715.tar.xz
sssd_unused-2d07aa724c93bbaec2cd29470941c0754c74f715.zip
sss_idmap: fix typo which prevents sub auth larger then 2^31
A test to cover this is added as well.
Diffstat (limited to 'src/lib')
-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 1d3ffb3b..a3360422 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;