r22696: Make sure this is an ascii char
authorSimo Sorce <idra@samba.org>
Sun, 6 May 2007 15:17:14 +0000 (15:17 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 19:52:02 +0000 (14:52 -0500)
spotted by Volker
(This used to be commit e24812016f60f506f0df2cb5ba8c2c6987f7da40)

source4/lib/ldb/common/ldb_dn.c

index ea7c6b5f690666c0aa17d4aa836c4c596c297caa..a277c71ba2e0688548a3bf4c90b169d407a62d58 100644 (file)
@@ -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;