}
static WERROR ldb_get_default_value(TALLOC_CTX *mem_ctx, struct hive_key *k,
- const char** name, uint32_t *data_type,
+ const char **name, uint32_t *data_type,
DATA_BLOB *data)
{
struct ldb_key_data *kd = talloc_get_type(k, struct ldb_key_data);
}
if (max_valbufsize != NULL) {
+ uint32_t data_type;
DATA_BLOB data;
reg_ldb_unpack_value(mem_ctx,
lp_iconv_convenience(global_loadparm),
kd->values[i], NULL,
- NULL, &data);
+ &data_type, &data);
*max_valbufsize = MAX(*max_valbufsize, data.length);
talloc_free(data.data);
}
data.length = *r->in.length;
}
- /* and enough room for the name */
+ /* check if there is enough room for the name */
if (r->in.name->size < 2*strlen_m_term(data_name)) {
return WERR_MORE_DATA;
}
}
r->out.name->size = r->in.name->size;
- *r->out.value = data_type;
+ r->out.type = talloc(mem_ctx, uint32_t);
+ if (!r->out.type) {
+ return WERR_NOMEM;
+ }
+ *r->out.type = data_type;
/* check the client has enough room for the value */
if (r->in.value != NULL &&
value_data.length = *r->in.length;
}
- /* Just asking for the size of the buffer */
r->out.type = talloc(mem_ctx, uint32_t);
if (!r->out.type) {
return WERR_NOMEM;