提交 269e57ae 编写于 作者: M Markus Armbruster

json: Don't create JSON_ERROR tokens that won't be used

Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
Reviewed-by: NEric Blake <eblake@redhat.com>
Message-Id: <20180823164025.12553-37-armbru@redhat.com>
上级 ff281a27
...@@ -56,6 +56,8 @@ void json_message_process_token(JSONLexer *lexer, GString *input, ...@@ -56,6 +56,8 @@ void json_message_process_token(JSONLexer *lexer, GString *input,
case JSON_RSQUARE: case JSON_RSQUARE:
parser->bracket_count--; parser->bracket_count--;
break; break;
case JSON_ERROR:
goto out_emit;
default: default:
break; break;
} }
...@@ -71,10 +73,6 @@ void json_message_process_token(JSONLexer *lexer, GString *input, ...@@ -71,10 +73,6 @@ void json_message_process_token(JSONLexer *lexer, GString *input,
g_queue_push_tail(parser->tokens, token); g_queue_push_tail(parser->tokens, token);
if (type == JSON_ERROR) {
goto out_emit;
}
if (parser->brace_count < 0 || if (parser->brace_count < 0 ||
parser->bracket_count < 0 || parser->bracket_count < 0 ||
(parser->brace_count == 0 && (parser->brace_count == 0 &&
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册