ITS#6951 Fix two buffersize issue in "pcacheBind" config processing

Found with valgrind
This commit is contained in:
Ralf Haferkamp 2011-05-24 15:23:11 +02:00
parent aa8615b8a2
commit 5402fef6d7

View File

@ -445,7 +445,7 @@ ftemp_attrs( struct berval *ftemp, struct berval *template,
AttributeDescription **descs = NULL;
char *temp2;
temp2 = ch_malloc( ftemp->bv_len );
temp2 = ch_malloc( ftemp->bv_len + 1 );
p1 = ftemp->bv_val;
t1 = temp2;
@ -4263,7 +4263,7 @@ pc_bind_fail:
i = 0;
while ((eq = strchr(eq, '=' ))) {
eq++;
if ( eq[1] == ')' )
if ( eq[0] == ')' )
i++;
}
bv.bv_len = temp->bindftemp.bv_len + i;