From: Alan T. DeKok Date: Wed, 3 Jan 2024 14:17:11 +0000 (-0500) Subject: add missing return X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=43da4f38a71a3607e6a77f29c4b724c93edea634;p=thirdparty%2Ffreeradius-server.git add missing return --- diff --git a/src/lib/util/calc.c b/src/lib/util/calc.c index 948d617c862..e721a926907 100644 --- a/src/lib/util/calc.c +++ b/src/lib/util/calc.c @@ -2445,7 +2445,7 @@ int fr_value_calc_assignment_op(TALLOC_CTX *ctx, fr_value_box_t *dst, fr_token_t } } - if (rcode < 0) handle_result(dst->type, op, rcode); + if (rcode < 0) return handle_result(dst->type, op, rcode); return 0; } diff --git a/src/tests/keywords/edit-underflow b/src/tests/keywords/edit-underflow new file mode 100644 index 00000000000..2d69d8600df --- /dev/null +++ b/src/tests/keywords/edit-underflow @@ -0,0 +1,29 @@ +uint32 one +uint32 two + +# +# PRE: edit +# +&one := 4 +&two := 5 + +# +# First modification succeeds. The second modification fails, which +# also reverts the changes to the first one. +# +transaction { + &one += 5 + &two -= 16 # Run-time underflow! +} + +# +# The various edits above should have been reverted. +# +if !(&one == 4) { + test_fail +} + +if !(&two == 5) { + test_fail +} +success