summaryrefslogtreecommitdiffstats
path: root/src/responder/nss/nsssrv_cmd.c
diff options
context:
space:
mode:
authorStephen Gallagher <sgallagh@redhat.com>2011-12-05 13:40:51 -0500
committerStephen Gallagher <sgallagh@redhat.com>2011-12-05 14:24:29 -0500
commitf43a61a726dd704c6106fe0e23fae181ceab1743 (patch)
tree70cb8cfbc0a7d2109fb2ef713c50f25d8221baa4 /src/responder/nss/nsssrv_cmd.c
parent000b68ccae459f3b09ee544b3ff678c555c2496b (diff)
downloadsssd_unused-f43a61a726dd704c6106fe0e23fae181ceab1743.tar.gz
sssd_unused-f43a61a726dd704c6106fe0e23fae181ceab1743.tar.xz
sssd_unused-f43a61a726dd704c6106fe0e23fae181ceab1743.zip
Ignore NULL-terminator when checking UTF8-validity
Glib fails if the NULL-terminator is included when a length is specified.
Diffstat (limited to 'src/responder/nss/nsssrv_cmd.c')
-rw-r--r--src/responder/nss/nsssrv_cmd.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/responder/nss/nsssrv_cmd.c b/src/responder/nss/nsssrv_cmd.c
index 31a47210..6848413d 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;
}