[Swan-dev] possible ip_range_check.c bug caught by Coverity Scan
Andrew Cagney
andrew.cagney at gmail.com
Tue May 4 11:51:31 UTC 2021
Ah, yes.
On Tue, 4 May 2021 at 00:45, D. Hugh Redelmeier <hugh at mimosa.com> wrote:
> | From: scan-admin at coverity.com
>
> |
> ________________________________________________________________________________________________________
> | *** CID 1504581: Incorrect expression (COPY_PASTE_ERROR)
> | /testing/programs/ipcheck/ip_range_check.c: 395 in check_range_op_range()
> | 389 FAIL("ttorange(%s) failed: %s",
> t->R, oops); \
> | 390 }
> \
> | 391 } else {
> \
> | 392 l = unset_range;
> \
> | 393 }
> | 394 TT(l);
> | >>> CID 1504581: Incorrect expression (COPY_PASTE_ERROR)
> | >>> "l" in "l = unset_range" looks like a copy-paste error.
> | 395 TT(r);
> | 396 #undef TT
> | 397
> | 398 #define T(OP,L,R)
> \
> | 399 {
> \
> | 400 bool cond = OP(L,R);
> \
> |
> | ** CID 1504580: (UNREACHABLE)
> | /testing/programs/ipcheck/ip_address_check.c: 396 in check_addresses_to()
> | /testing/programs/ipcheck/ip_address_check.c: 403 in check_addresses_to()
>
> I'm not sure what it is complaining about but I think it might be
> right.
>
> Cagney: does this fix look correct?
>
> diff --git a/testing/programs/ipcheck/ip_range_check.c
> b/testing/programs/ipcheck/ip_range_check.c
> index 256cf76c70..9f9a27db58 100644
> --- a/testing/programs/ipcheck/ip_range_check.c
> +++ b/testing/programs/ipcheck/ip_range_check.c
> @@ -389,7 +389,7 @@ static void check_range_op_range(void)
> FAIL("ttorange(%s) failed: %s", t->R,
> oops); \
> } \
> } else { \
> - l = unset_range; \
> + R = unset_range; \
> }
> TT(l);
> TT(r);
> _______________________________________________
> Swan-dev mailing list
> Swan-dev at lists.libreswan.org
> https://lists.libreswan.org/mailman/listinfo/swan-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.libreswan.org/pipermail/swan-dev/attachments/20210504/de913b03/attachment.html>
More information about the Swan-dev
mailing list