- Don't silently drop records with empty attributes
tridge/simo: Could you please verify this patch is correct?
{
*out = ldb_val_dup(mem_ctx, in);
- if (out->length == 0) {
+ if (out->data == NULL && in->data != NULL) {
return -1;
}
msg->dn = ldb_dn_explode(msg, value.data);
+ if (msg->dn == NULL) {
+ ldb_debug(ldb, LDB_DEBUG_ERROR, "Error: Unable to parse dn '%s'\n",
+ value.data);
+ goto failed;
+ }
+
while (next_attr(ldif, &s, &attr, &value) == 0) {
const struct ldb_attrib_handler *h;
struct ldb_message_element *el;
{
struct ldb_val v2;
v2.length = v->length;
- if (v->length == 0) {
+ if (v->data == NULL) {
v2.data = NULL;
return v2;
}