mirror of
https://github.com/postgres/postgres.git
synced 2025-06-13 07:41:39 +03:00
Fix incorrect logic in JSON number lexer
Detectable by gcc -Wlogical-op. Add two regression test cases that would previously allow incorrect values to pass.
This commit is contained in:
@ -541,7 +541,7 @@ json_lex_number(JsonLexContext *lex, char *s)
|
||||
if (*s == '.')
|
||||
{
|
||||
++s;
|
||||
if (*s < '0' && *s > '9')
|
||||
if (*s < '0' || *s > '9')
|
||||
error = true;
|
||||
else
|
||||
{
|
||||
@ -558,7 +558,7 @@ json_lex_number(JsonLexContext *lex, char *s)
|
||||
++s;
|
||||
if (*s == '+' || *s == '-')
|
||||
++s;
|
||||
if (*s < '0' && *s > '9')
|
||||
if (*s < '0' || *s > '9')
|
||||
error = true;
|
||||
else
|
||||
{
|
||||
|
Reference in New Issue
Block a user