diff options
author | Pavel Březina <pbrezina@redhat.com> | 2012-02-10 17:30:37 +0100 |
---|---|---|
committer | Stephen Gallagher <sgallagh@redhat.com> | 2012-02-10 13:29:54 -0500 |
commit | 4115a5f49297e102b0ab06d28c914a9a213ceb00 (patch) | |
tree | 3bc4526e6ac2d79d1481259e3ae9d215cafbb1b9 /src/responder | |
parent | feec504cd6326b261aa88bf5a91bd806f4878d86 (diff) | |
download | sssd-4115a5f49297e102b0ab06d28c914a9a213ceb00.tar.gz sssd-4115a5f49297e102b0ab06d28c914a9a213ceb00.tar.xz sssd-4115a5f49297e102b0ab06d28c914a9a213ceb00.zip |
SUDO responder: check if the input is a UTF-8 string
https://fedorahosted.org/sssd/ticket/1171
Diffstat (limited to 'src/responder')
-rw-r--r-- | src/responder/sudo/sudosrv_cmd.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/responder/sudo/sudosrv_cmd.c b/src/responder/sudo/sudosrv_cmd.c index f179b9233..52023bec3 100644 --- a/src/responder/sudo/sudosrv_cmd.c +++ b/src/responder/sudo/sudosrv_cmd.c @@ -194,6 +194,13 @@ static int sudosrv_cmd_get_sudorules(struct cli_ctx *cli_ctx) goto done; } + /* If the body isn't valid UTF-8, fail */ + if (!sss_utf8_check(query_body, query_len - 1)) { + DEBUG(SSSDBG_CRIT_FAILURE, ("Supplied data is not valid UTF-8 string\n")); + ret = EINVAL; + goto done; + } + /* parse query */ rawname = sudosrv_get_sudorules_parse_query(cmd_ctx, (const char*)query_body, |