Use ldb_dn_from_ldb_val to avoid possible over-run of the value.
[ira/wip.git] / source4 / lib / ldb / common / ldb_match.c
index 64d0e5476168586ab10b08b7ffdec75bf98e38e9..4cde739d672cc98a91755b8bbcbfeea153fc93c1 100644 (file)
@@ -147,7 +147,7 @@ static int ldb_match_equality(struct ldb_context *ldb,
        int ret;
 
        if (ldb_attr_dn(tree->u.equality.attr) == 0) {
-               valuedn = ldb_dn_new(ldb, ldb, (char *)tree->u.equality.value.data);
+               valuedn = ldb_dn_from_ldb_val(ldb, ldb, &tree->u.equality.value);
                if (valuedn == NULL) {
                        return 0;
                }