From 2d07aa724c93bbaec2cd29470941c0754c74f715 Mon Sep 17 00:00:00 2001 From: Sumit Bose Date: Fri, 1 Jun 2012 13:08:04 +0200 Subject: sss_idmap: fix typo which prevents sub auth larger then 2^31 A test to cover this is added as well. --- src/lib/idmap/sss_idmap_conv.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/lib') 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; -- cgit