Suspicious strcmp() in src/backend/parser/parse_expr.c

From: Rikard Falkeborn <rikard(dot)falkeborn(at)gmail(dot)com>
To: pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Suspicious strcmp() in src/backend/parser/parse_expr.c
Date: 2019-04-10 21:40:53
Message-ID: CADRDgG6fzA8A2oeygUw4=o7ywo4kvz26NxCSgpq22nMD73Bx4Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

In src/backend/parser/parse_expr.c the following snippet of code is found
(lines 3238-3242, rev 765525c8c2c6e55abe):

if (strcmp(*nodename, "+") == 0 ||
strcmp(*nodename, "-")) // <-- notice the lack of comparisson
here
group = 0;
else
group = PREC_GROUP_PREFIX_OP;

Should the second part of the || be strcmp(*nodename, "-") == 0?

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Andrew Gierth 2019-04-10 22:33:35 Re: Suspicious strcmp() in src/backend/parser/parse_expr.c
Previous Message Chandan Ahuja 2019-04-10 20:59:10 Re: BUG #15737: Unexpectedly Deleting full table when referring CTE (With Clause ) data,in a Subquery in another CTE