mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-12-26 09:39:45 -05:00
fix previous commit (ITS#6611)
This commit is contained in:
parent
ab4f21d5a0
commit
672e87776a
1 changed files with 3 additions and 3 deletions
|
|
@ -2538,7 +2538,7 @@ str2access( const char *str )
|
|||
static char *
|
||||
safe_strncopy( char *ptr, const char *src, size_t n, struct berval *buf )
|
||||
{
|
||||
while ( &ptr[n] >= &buf->bv_val[buf->bv_len] ) {
|
||||
while ( ptr + n >= buf->bv_val + buf->bv_len ) {
|
||||
char *tmp = ch_realloc( buf->bv_val, 2*buf->bv_len );
|
||||
if ( tmp == NULL ) {
|
||||
return NULL;
|
||||
|
|
@ -2782,10 +2782,9 @@ acl_unparse( AccessControl *a, struct berval *bv )
|
|||
aclbuf.bv_len = ACLBUF_CHUNKSIZE;
|
||||
}
|
||||
|
||||
bv->bv_val = aclbuf.bv_val;
|
||||
bv->bv_len = 0;
|
||||
|
||||
ptr = bv->bv_val;
|
||||
ptr = aclbuf.bv_val;
|
||||
|
||||
ptr = acl_safe_strcopy( ptr, "to" );
|
||||
if ( !BER_BVISNULL( &a->acl_dn_pat ) ) {
|
||||
|
|
@ -2853,6 +2852,7 @@ acl_unparse( AccessControl *a, struct berval *bv )
|
|||
ptr = access2text( b, ptr );
|
||||
}
|
||||
*ptr = '\0';
|
||||
bv->bv_val = aclbuf.bv_val;
|
||||
bv->bv_len = ptr - bv->bv_val;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue