Skip to content
Snippets Groups Projects
Commit 52e5e0aa authored by Quanah Gibson-Mount's avatar Quanah Gibson-Mount
Browse files

More for ITS#6353

parent 2c3c10d6
No related branches found
No related tags found
No related merge requests found
......@@ -279,6 +279,9 @@ ber_get_stringb LDAP_P((
#define LBER_BV_ALLOC 0x01 /* allocate/copy result, otherwise in-place */
#define LBER_BV_NOTERM 0x02 /* omit NUL-terminator if parsing in-place */
#define LBER_BV_STRING 0x04 /* fail if berval contains embedded \0 */
/* LBER_BV_STRING currently accepts a terminating \0 in the berval, because
* Active Directory sends that in at least the diagonsticMessage field.
*/
LBER_F( ber_tag_t )
ber_get_stringbv LDAP_P((
......
......@@ -481,7 +481,8 @@ ber_get_stringbv( BerElement *ber, struct berval *bv, int option )
tag = ber_skip_element( ber, bv );
if ( tag == LBER_DEFAULT ||
(( option & LBER_BV_STRING ) && memchr( bv->bv_val, 0, bv->bv_len )))
(( option & LBER_BV_STRING ) &&
bv->bv_len && memchr( bv->bv_val, 0, bv->bv_len - 1 )))
{
bv->bv_val = NULL;
return LBER_DEFAULT;
......@@ -518,7 +519,9 @@ ber_get_stringbv_null( BerElement *ber, struct berval *bv, int option )
return tag;
}
if (( option & LBER_BV_STRING ) && memchr( bv->bv_val, 0, bv->bv_len )) {
if (( option & LBER_BV_STRING ) &&
memchr( bv->bv_val, 0, bv->bv_len - 1 ))
{
bv->bv_val = NULL;
return LBER_DEFAULT;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment