From: Olaf Wintermann Date: Wed, 12 Jan 2022 18:16:57 +0000 (+0100) Subject: fix json_reader_literal X-Git-Url: https://uap-core.de/gitweb/?a=commitdiff_plain;h=45b79be2f6cf1e23f0e50747934390c01625af8b;p=uwplayer.git fix json_reader_literal --- diff --git a/application/json.c b/application/json.c index 719a570..5a5446e 100644 --- a/application/json.c +++ b/application/json.c @@ -614,9 +614,10 @@ int json_reader_isnull(JSONParser *p) { JSONLiteralType json_reader_literal(JSONParser *p) { const char *l = p->reader_token.content; - if(!strcmp(l, "true")) { + size_t token_len = p->reader_token.length; + if(token_len == 4 && !memcpy(l, "true", 5)) { return JSON_TRUE; - } else if(!strcmp(l, "false")) { + } else if(token_len == 5 && !memcpy(l, "false", 5)) { return JSON_FALSE; } return JSON_NULL;