From: Pierangelo Masarati Date: Sun, 6 Nov 2005 11:41:42 +0000 (+0000) Subject: fix ldap_bv2escaped_filter_value X-Git-Tag: OPENLDAP_REL_ENG_2_2_MP~85 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=e1a7fa2ee9f10fb4d2fc8c7d38b87601277812d0;p=openldap fix ldap_bv2escaped_filter_value --- diff --git a/libraries/libldap/search.c b/libraries/libldap/search.c index d78eeb84ad..9a637ef7dc 100644 --- a/libraries/libldap/search.c +++ b/libraries/libldap/search.c @@ -368,7 +368,6 @@ ldap_search_s( int ldap_bv2escaped_filter_value( struct berval *in, struct berval *out ) { - char c; ber_len_t i; static char escape[128] = { 1, 1, 1, 1, 1, 1, 1, 1, @@ -402,7 +401,8 @@ ldap_bv2escaped_filter_value( struct berval *in, struct berval *out ) if( out->bv_val == NULL ) return -1; for( i=0; ibv_len; i++ ) { - if (c & 0x80 || escape[in->bv_val[i]]) { + char c = in->bv_val[ i ]; + if (c & 0x80 || escape[ c ]) { out->bv_val[out->bv_len++] = '\\'; out->bv_val[out->bv_len++] = "0123456789ABCDEF"[0x0f & (c>>4)]; out->bv_val[out->bv_len++] = "0123456789ABCDEF"[0x0f & c];