summaryrefslogtreecommitdiffstats
path: root/src/responder/nss/nsssrv_netgroup.c
diff options
context:
space:
mode:
authorStephen Gallagher <sgallagh@redhat.com>2011-11-14 11:31:37 -0500
committerStephen Gallagher <sgallagh@redhat.com>2011-11-18 12:18:33 -0500
commit872f2d32d979a1dd2145667487f170fec8b5189a (patch)
tree44a6f75159cb3c9b3f5da4048d1d4bd343de89a1 /src/responder/nss/nsssrv_netgroup.c
parent37a76cff2478d8be3d11ccb7ff42d9d863f1839e (diff)
downloadsssd-872f2d32d979a1dd2145667487f170fec8b5189a.tar.gz
sssd-872f2d32d979a1dd2145667487f170fec8b5189a.tar.xz
sssd-872f2d32d979a1dd2145667487f170fec8b5189a.zip
RESPONDER: Ensure that all input strings are valid UTF-8
Diffstat (limited to 'src/responder/nss/nsssrv_netgroup.c')
-rw-r--r--src/responder/nss/nsssrv_netgroup.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/responder/nss/nsssrv_netgroup.c b/src/responder/nss/nsssrv_netgroup.c
index cd0ba723a..7d5665d41 100644
--- a/src/responder/nss/nsssrv_netgroup.c
+++ b/src/responder/nss/nsssrv_netgroup.c
@@ -113,6 +113,13 @@ int nss_cmd_setnetgrent(struct cli_ctx *client)
ret = EINVAL;
goto done;
}
+
+ /* If the body isn't valid UTF-8, fail */
+ if (!sss_utf8_check(body, blen)) {
+ ret = EINVAL;
+ goto done;
+ }
+
rawname = (const char *)body;
req = setnetgrent_send(cmdctx, rawname, cmdctx);