From 207862764a8dd75911563dd4b68af88d4e2e13a9 Mon Sep 17 00:00:00 2001 From: Douglas Bagnall Date: Wed, 8 Jul 2020 10:04:44 +1200 Subject: [PATCH] ldb_dn: escape ';' and '=' in short form It is mandatory to escape certain characters directly and others in hex mode. We had it wrong. Signed-off-by: Douglas Bagnall --- lib/ldb/common/ldb_dn.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/ldb/common/ldb_dn.c b/lib/ldb/common/ldb_dn.c index 9f72af97611..6b554328c0b 100644 --- a/lib/ldb/common/ldb_dn.c +++ b/lib/ldb/common/ldb_dn.c @@ -216,17 +216,16 @@ static int ldb_dn_escape_internal(char *dst, const char *src, int len) case '+': case '"': case '\\': + case ';': case '<': + case '=': case '>': /* these must be escaped using \c form */ *d++ = '\\'; *d++ = c; break; - - case ';': case '\r': case '\n': - case '=': case '\0': { /* any others get \XX form */ unsigned char v; -- 2.17.1