]> git.sur5r.net Git - openldap/commitdiff
ITS#8842 Do some printability checks on the dc RDN
authorOndřej Kuzník <ondra@openldap.org>
Thu, 21 Jun 2018 15:01:43 +0000 (16:01 +0100)
committerOndřej Kuzník <ondra@openldap.org>
Mon, 2 Jul 2018 15:18:26 +0000 (16:18 +0100)
libraries/libldap/getdn.c

index 06c9e39192676d06fc62e292020e532d2bbbea7b..4c5fe5b2d5e5107a60d47904c1ceea206b1dc2d2 100644 (file)
@@ -27,6 +27,7 @@
 
 #include "ldap-int.h"
 #include "ldap_schema.h"
+#include "ldif.h"
 
 /* extension to UFN that turns trailing "dc=value" rdns in DNS style,
  * e.g. "ou=People,dc=openldap,dc=org" => "People, openldap.org" */
@@ -2478,6 +2479,11 @@ dn2domain( LDAPDN dn, struct berval *bv, int pos, int *iRDN )
                        break;
                }
 
+               if ( ldif_is_not_printable( ava->la_value.bv_val, ava->la_value.bv_len ) ) {
+                       domain = 0;
+                       break;
+               }
+
                domain = 1;
                
                if ( first ) {