mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-12-24 00:29:35 -05:00
make lutil_uuidstr_from_normalized() return the length of the string
This commit is contained in:
parent
0c90b9ece2
commit
ca1aed557b
3 changed files with 11 additions and 4 deletions
|
|
@ -418,7 +418,7 @@ lutil_uuidstr_from_normalized(
|
|||
}
|
||||
|
||||
if ( buflen > 36 ) buf[36] = '\0';
|
||||
return 0;
|
||||
return 36;
|
||||
}
|
||||
|
||||
#ifdef TEST
|
||||
|
|
|
|||
|
|
@ -3442,10 +3442,14 @@ pcache_parse_query_delete(
|
|||
goto decoding_error;
|
||||
}
|
||||
|
||||
lutil_uuidstr_from_normalized(
|
||||
rc = lutil_uuidstr_from_normalized(
|
||||
bv.bv_val, bv.bv_len,
|
||||
uuidbuf, sizeof( uuidbuf ) );
|
||||
ber_str2bv( uuidbuf, 36, 1, uuid );
|
||||
if ( rc == -1 ) {
|
||||
goto decoding_error;
|
||||
}
|
||||
ber_str2bv( uuidbuf, rc, 1, uuid );
|
||||
rc = LDAP_SUCCESS;
|
||||
|
||||
} else {
|
||||
tag = ber_skip_tag( ber, &len );
|
||||
|
|
|
|||
|
|
@ -3110,7 +3110,7 @@ slap_uuidstr_from_normalized(
|
|||
normalized->bv_len, new->bv_val, new->bv_len + 1 );
|
||||
|
||||
done:;
|
||||
if ( rc != 0 ) {
|
||||
if ( rc == -1 ) {
|
||||
if ( new != NULL ) {
|
||||
if ( new->bv_val != NULL ) {
|
||||
slap_sl_free( new->bv_val, ctx );
|
||||
|
|
@ -3121,6 +3121,9 @@ done:;
|
|||
}
|
||||
}
|
||||
new = NULL;
|
||||
|
||||
} else {
|
||||
new->bv_len = rc;
|
||||
}
|
||||
|
||||
return new;
|
||||
|
|
|
|||
Loading…
Reference in a new issue