/* $OpenLDAP$ */
/* This work is part of OpenLDAP Software <http://www.openldap.org/>.
*
- * Copyright 1998-2009 The OpenLDAP Foundation.
+ * Copyright 1998-2013 The OpenLDAP Foundation.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
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;
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;
}