From 3a0ffb92ef6909c3cf54911c23dc3db6fcea6b7e Mon Sep 17 00:00:00 2001 From: Carlos Medeiros Date: Fri, 29 Nov 2024 16:21:30 +0000 Subject: [PATCH] move verification --- app/Makefile.version | 2 +- app/src/tx_validate.c | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/app/Makefile.version b/app/Makefile.version index 979a4dde..2f6ef07a 100644 --- a/app/Makefile.version +++ b/app/Makefile.version @@ -3,4 +3,4 @@ APPVERSION_M=2 # This is the `spec_version` field of `Runtime` APPVERSION_N=35 # This is the patch version of this release -APPVERSION_P=26 +APPVERSION_P=27 diff --git a/app/src/tx_validate.c b/app/src/tx_validate.c index 057530d3..c3d30c19 100644 --- a/app/src/tx_validate.c +++ b/app/src/tx_validate.c @@ -51,15 +51,14 @@ parser_error_t contains_whitespace(parsed_json_t *json) { } } start = json->tokens[i].end + 1; + if (start < 0) { + return parser_json_unexpected_error; + } } else { return parser_ok; } } - if (start < 0) { - return parser_json_unexpected_error; - } - while (start < last_element_index && json->buffer[start] != '\0') { if (is_space(json->buffer[start])) { return parser_json_contains_whitespace;