summaryrefslogtreecommitdiffstats
path: root/src/responder/nss
diff options
context:
space:
mode:
Diffstat (limited to 'src/responder/nss')
-rw-r--r--src/responder/nss/nsssrv_cmd.c21
-rw-r--r--src/responder/nss/nsssrv_netgroup.c7
2 files changed, 28 insertions, 0 deletions
diff --git a/src/responder/nss/nsssrv_cmd.c b/src/responder/nss/nsssrv_cmd.c
index 8f4cb4401..a37bd7664 100644
--- a/src/responder/nss/nsssrv_cmd.c
+++ b/src/responder/nss/nsssrv_cmd.c
@@ -873,6 +873,13 @@ static int nss_cmd_getpwnam(struct cli_ctx *cctx)
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;
domname = NULL;
@@ -2140,6 +2147,13 @@ static int nss_cmd_getgrnam(struct cli_ctx *cctx)
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;
domname = NULL;
@@ -3180,6 +3194,13 @@ static int nss_cmd_initgroups(struct cli_ctx *cctx)
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;
domname = NULL;
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);