/* $OpenLDAP$ */
/* This work is part of OpenLDAP Software <http://www.openldap.org/>.
*
- * Copyright 2000-2008 The OpenLDAP Foundation.
+ * Copyright 2000-2017 The OpenLDAP Foundation.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
int flags
)
{
- ber_len_t len = strlen( value );
+ ber_len_t len;
+
+ assert( value != NULL );
+
+ len = strlen( value );
if ( var->lv_flags & REWRITE_VAR_COPY_VALUE ) {
if ( flags & REWRITE_VAR_COPY_VALUE ) {
}
}
+ if ( var->lv_value.bv_val == NULL ) {
+ return -1;
+ }
+
var->lv_value.bv_len = len;
return 0;