From 31d28c5b8cc22fb158a808a1f9d3d0c8ed5d2090 Mon Sep 17 00:00:00 2001 From: Simo Sorce Date: Sun, 6 May 2007 15:17:14 +0000 Subject: r22696: Make sure this is an ascii char spotted by Volker (This used to be commit e24812016f60f506f0df2cb5ba8c2c6987f7da40) --- source4/lib/ldb/common/ldb_dn.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/source4/lib/ldb/common/ldb_dn.c b/source4/lib/ldb/common/ldb_dn.c index ea7c6b5f69..a277c71ba2 100644 --- a/source4/lib/ldb/common/ldb_dn.c +++ b/source4/lib/ldb/common/ldb_dn.c @@ -292,6 +292,12 @@ static bool ldb_dn_explode(struct ldb_dn *dn) /* first char */ trim = false; + if (!isascii(*p)) { + /* attr names must be ascii only */ + dn->invalid = true; + goto failed; + } + if (isdigit(*p)) { is_oid = true; } else @@ -338,6 +344,12 @@ static bool ldb_dn_explode(struct ldb_dn *dn) continue; } + if (!isascii(*p)) { + /* attr names must be ascii only */ + dn->invalid = true; + goto failed; + } + if (is_oid && ( ! (isdigit(*p) || (*p == '.')))) { /* not a digit nor a dot, invalid attribute oid */ dn->invalid = true; -- cgit