From 427478a75328d87b18f9b4d044697edf0d53441e Mon Sep 17 00:00:00 2001 From: Kurt Zeilenga Date: Wed, 13 Feb 2002 17:48:39 +0000 Subject: [PATCH] Use memchr, not strlen, to look for embedded NULs. --- libraries/libldap/getdn.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libraries/libldap/getdn.c b/libraries/libldap/getdn.c index 11b436bdcf..15980e2c2c 100644 --- a/libraries/libldap/getdn.c +++ b/libraries/libldap/getdn.c @@ -652,7 +652,7 @@ ldap_bv2dn( struct berval *bv, LDAPDN **dn, unsigned flags ) return LDAP_SUCCESS; } - if( strlen( bv->bv_val ) != bv->bv_len ) { + if( memchr( bv->bv_val, '\0', bv->bv_len ) != NULL ) { /* value must have embedded NULs */ return LDAP_DECODING_ERROR; } @@ -883,7 +883,7 @@ ldap_bv2rdn( struct berval *bv, LDAPRDN **rdn, } - if( strlen( bv->bv_val ) != bv->bv_len ) { + if( memchr( bv->bv_val, '\0', bv->bv_len ) != NULL ) { /* value must have embedded NULs */ return LDAP_DECODING_ERROR; } -- 2.39.5