diff options
-rw-r--r-- | src/responder/nss/nsssrv_cmd.c | 6 | ||||
-rw-r--r-- | src/responder/pam/pamsrv_cmd.c | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/src/responder/nss/nsssrv_cmd.c b/src/responder/nss/nsssrv_cmd.c index fcfacb73..8e40bd2e 100644 --- a/src/responder/nss/nsssrv_cmd.c +++ b/src/responder/nss/nsssrv_cmd.c @@ -912,7 +912,7 @@ static int nss_cmd_getpwnam(struct cli_ctx *cctx) } /* If the body isn't valid UTF-8, fail */ - if (!sss_utf8_check(body, blen)) { + if (!sss_utf8_check(body, blen -1)) { ret = EINVAL; goto done; } @@ -2199,7 +2199,7 @@ static int nss_cmd_getgrnam(struct cli_ctx *cctx) } /* If the body isn't valid UTF-8, fail */ - if (!sss_utf8_check(body, blen)) { + if (!sss_utf8_check(body, blen -1)) { ret = EINVAL; goto done; } @@ -3257,7 +3257,7 @@ static int nss_cmd_initgroups(struct cli_ctx *cctx) } /* If the body isn't valid UTF-8, fail */ - if (!sss_utf8_check(body, blen)) { + if (!sss_utf8_check(body, blen -1)) { ret = EINVAL; goto done; } diff --git a/src/responder/pam/pamsrv_cmd.c b/src/responder/pam/pamsrv_cmd.c index 2a000f09..40df755d 100644 --- a/src/responder/pam/pamsrv_cmd.c +++ b/src/responder/pam/pamsrv_cmd.c @@ -71,7 +71,7 @@ static int extract_string(char **var, size_t size, uint8_t *body, size_t blen, if (str[size-1]!='\0') return EINVAL; /* If the string isn't valid UTF-8, fail */ - if (!sss_utf8_check(str, size)) { + if (!sss_utf8_check(str, size-1)) { return EINVAL; } |