Index: /server/common/oursrc/httpdmods/mod_vhost_ldap.c
===================================================================
--- /server/common/oursrc/httpdmods/mod_vhost_ldap.c	(revision 673)
+++ /server/common/oursrc/httpdmods/mod_vhost_ldap.c	(revision 674)
@@ -420,30 +420,21 @@
 };
 
-char* mod_vhost_ldap_sanitize(apr_pool_t* p, const char* source) {
-    char* target = apr_palloc(p, 3*strlen(source)+1);
+char *mod_vhost_ldap_escape(apr_pool_t *p, const char *source)
+{
+    char *target = apr_palloc(p, 3 * strlen(source) + 1);
+    char *result = target;
     for (; *source; source++) {
 	switch (*source) {
-	    case '*':
-		strcpy(target, "\\2a");
-		target += 3;
-		break;
-	    case '(':
-		strcpy(target, "\\28");
-		target += 3;
-		break;
-	    case ')':
-		strcpy(target, "\\29");
-		target += 3;
-		break;
-	    case '\\':
-		strcpy(target, "\\5c");
+	    case '*': case '(': case ')': case '\\':
+		sprintf(target, "\\%02hhx", *source);
 		target += 3;
 		break;
 	    default:
 		*target++ = *source;
+		break;
 	}
     }
     *target = '\0';
-    return target;
+    return result;
 }
 
@@ -499,5 +490,5 @@
 		   "[mod_vhost_ldap.c]: translating %s", r->uri);
 
-    s_hostname = mod_vhost_ldap_sanitize(r->pool, hostname);
+    s_hostname = mod_vhost_ldap_escape(r->pool, hostname);
     apr_snprintf(filtbuf, FILTER_LENGTH, "(&(%s)(|(apacheServerName=%s)(apacheServerAlias=%s)))", conf->filter, s_hostname, s_hostname);
 
