From d03f17c2dbaa8235725d6ea9d9474557fdd0f8f7 Mon Sep 17 00:00:00 2001 From: Stephen Gallagher Date: Mon, 5 Dec 2011 13:40:51 -0500 Subject: Ignore NULL-terminator when checking UTF8-validity Glib fails if the NULL-terminator is included when a length is specified. --- src/responder/nss/nsssrv_cmd.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/responder/nss/nsssrv_cmd.c') diff --git a/src/responder/nss/nsssrv_cmd.c b/src/responder/nss/nsssrv_cmd.c index 31a47210d..6848413dd 100644 --- a/src/responder/nss/nsssrv_cmd.c +++ b/src/responder/nss/nsssrv_cmd.c @@ -875,7 +875,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; } @@ -2149,7 +2149,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; } @@ -3196,7 +3196,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; } -- cgit