From: Alan T. DeKok Date: Wed, 10 Aug 2022 13:26:09 +0000 (-0400) Subject: cast values, not copy X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a9ad43edc65df1e97a2ed9dc7039cc09aae086b7;p=thirdparty%2Ffreeradius-server.git cast values, not copy which lets the parser return uint8, and then we assign that value to a uint32 attribute. --- diff --git a/src/lib/unlang/edit.c b/src/lib/unlang/edit.c index 3c134eaeeff..c5f25ec5a1c 100644 --- a/src/lib/unlang/edit.c +++ b/src/lib/unlang/edit.c @@ -679,7 +679,7 @@ redo: MEM(vp = fr_pair_afrom_da(current, current->parent->lhs.vp->da)); if (tmpl_is_data(current->lhs.vpt)) { - if (fr_value_box_copy(vp, &vp->data, tmpl_value(current->lhs.vpt)) < 0) goto error; + if (fr_value_box_cast(vp, &vp->data, vp->da->type, vp->da, tmpl_value(current->lhs.vpt)) < 0) goto error; } else { fr_pair_t *ref; diff --git a/src/tests/keywords/edit-leaf-star b/src/tests/keywords/edit-leaf-star index 270c29e3a78..3e0b2ccf42a 100644 --- a/src/tests/keywords/edit-leaf-star +++ b/src/tests/keywords/edit-leaf-star @@ -1,13 +1,7 @@ # # PRE: edit # -&request += { - &Tmp-Integer-0 = 1 - &Tmp-Integer-0 = 3 - &Tmp-Integer-0 = 5 - &Tmp-Integer-0 = 7 - &Tmp-Integer-0 = 11 -} +&request.Tmp-Integer-0 := { 1, 3, 5, 7, 11 } &Tmp-Integer-1 := 0