Suspicious strcmp() in src/backend/parser/parse_expr.c
Rikard Falkeborn <rikard.falkeborn@gmail.com>
From: Rikard Falkeborn <rikard.falkeborn@gmail.com>
To: pgsql-bugs@lists.postgresql.org
Date: 2019-04-10T21:40:53Z
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?
Commits
-
Fix more strcmp() calls using boolean-like comparisons for result checks
- d527fda62167 12.0 landed
-
Fix backwards test in operator_precedence_warning logic.
- b9b7fe8ca452 9.5.17 landed
- 62d495395619 9.6.13 landed
- 99bbff5c1579 10.8 landed
- 930930c47663 11.3 landed
- 4cae471d1b6b 12.0 landed