Skip to content

Commit

Permalink
Perform implicit cast earlier in map_to_vp
Browse files Browse the repository at this point in the history
Conflicts:
	src/main/map.c
  • Loading branch information
arr2036 committed Aug 21, 2015
1 parent 9133027 commit dde46ec
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/main/map.c
Expand Up @@ -946,7 +946,19 @@ int map_to_vp(TALLOC_CTX *ctx, VALUE_PAIR **out, REQUEST *request, vp_map_t cons
new = fr_pair_afrom_da(ctx, map->lhs->tmpl_da);
if (!new) return -1;

if (value_data_copy(new, &new->data, new->da->type, &map->rhs->tmpl_data_value) < 0) goto error;
if (map->lhs->tmpl_da->type == map->rhs->tmpl_data_type) {
if (value_data_copy(new, &new->data, new->da->type, &map->rhs->tmpl_data_value) < 0) {
rcode = -1;
goto error;
}
} else {
if (value_data_cast(new, &new->data, new->da->type, new->da, map->rhs->tmpl_data_type,
NULL, &map->rhs->tmpl_data_value) < 0) {
REDEBUG("Implicit cast failed: %s", fr_strerror());
rcode = -1;
goto error;
}
}
new->op = map->op;
new->tag = map->lhs->tmpl_tag;
*out = new;
Expand Down

0 comments on commit dde46ec

Please sign in to comment.