summaryrefslogtreecommitdiffstats
path: root/src/responder/common
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/common
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/common')
-rw-r--r--src/responder/common/responder.h2
-rw-r--r--src/responder/common/responder_common.c9
2 files changed, 11 insertions, 0 deletions
diff --git a/src/responder/common/responder.h b/src/responder/common/responder.h
index 321cedda8..1b39fdd5b 100644
--- a/src/responder/common/responder.h
+++ b/src/responder/common/responder.h
@@ -174,4 +174,6 @@ int sss_dp_send_acct_req(struct resp_ctx *rctx, TALLOC_CTX *callback_memctx,
int responder_logrotate(DBusMessage *message,
struct sbus_connection *conn);
+bool sss_utf8_check(const uint8_t *s, size_t n);
+
#endif /* __SSS_RESPONDER_H__ */
diff --git a/src/responder/common/responder_common.c b/src/responder/common/responder_common.c
index 719f24647..f97ec06fd 100644
--- a/src/responder/common/responder_common.c
+++ b/src/responder/common/responder_common.c
@@ -32,6 +32,7 @@
#include <sys/time.h>
#include <errno.h>
#include <popt.h>
+#include <unistr.h>
#include "util/util.h"
#include "db/sysdb.h"
#include "confdb/confdb.h"
@@ -627,3 +628,11 @@ int responder_logrotate(DBusMessage *message,
return monitor_common_pong(message, conn);
}
+
+bool sss_utf8_check(const uint8_t *s, size_t n)
+{
+ if (u8_check(s, n) == NULL) {
+ return true;
+ }
+ return false;
+}