Re: BUG #18914: REDUNDANT_COMPARISON.ALWAYS_FALSE Redundant comparison '0' > 'nb' (0 > {4, 16}) is always false

From: David Rowley <dgrowleyml(at)gmail(dot)com>
To: gorcom2012(at)gmail(dot)com, pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #18914: REDUNDANT_COMPARISON.ALWAYS_FALSE Redundant comparison '0' > 'nb' (0 > {4, 16}) is always false
Date: 2025-05-07 10:34:16
Message-ID: CAApHDvox1wd1=2yPdgcW2RNhNWMbppc8Y1=qq=AzngxaNpiGkA@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Wed, 7 May 2025 at 21:28, PG Bug reporting form
<noreply(at)postgresql(dot)org> wrote:
> @@ -279,8 +279,7 @@ network_send(inet *addr, bool is_cidr)
> pq_sendbyte(&buf, ip_bits(addr));
> pq_sendbyte(&buf, is_cidr);
> nb = ip_addrsize(addr);
> - if (nb < 0)
> - nb = 0;
> + Assert(nb >= 0);

This has already been fixed in master by [1]. Since there's no actual
misbehaviour, there was no backpatch.

David

[1] https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=f27eb0325b7b2cff3b880fa669913693849521dc

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Daniel Gustafsson 2025-05-07 10:35:30 Re: BUG #18914: REDUNDANT_COMPARISON.ALWAYS_FALSE Redundant comparison '0' > 'nb' (0 > {4, 16}) is always false
Previous Message PG Bug reporting form 2025-05-07 08:48:44 BUG #18914: REDUNDANT_COMPARISON.ALWAYS_FALSE Redundant comparison '0' > 'nb' (0 > {4, 16}) is always false