Skip to content

Commit

Permalink
Correct multivalued JSON attribute parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
arr2036 committed Mar 24, 2014
1 parent 0659aeb commit 512aada
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/modules/rlm_rest/rest.c
Expand Up @@ -1280,7 +1280,7 @@ static int json_pairmake(rlm_rest_t *instance, UNUSED rlm_rest_section_t *sectio
/*
* Automagically switch the op for multivalued attributes.
*/
if (((flags.op == T_OP_SET) || (flags.op == T_OP_EQ)) && (i > 1)) {
if (((flags.op == T_OP_SET) || (flags.op == T_OP_EQ)) && (i >= 1)) {
flags.op = T_OP_ADD;
}

Expand All @@ -1298,7 +1298,7 @@ static int json_pairmake(rlm_rest_t *instance, UNUSED rlm_rest_section_t *sectio
vp = json_pairmake_leaf(instance, section, request, dst.da, &flags, element);
if (!vp) continue;
}

debug_pair(vp);
radius_pairmove(current, vps, vp);
/*
* If we call json_object_array_get_idx on something that's not an array
Expand Down

0 comments on commit 512aada

Please sign in to comment.