mirror of
				https://github.com/eledio-devices/thirdparty-ArduinoJson.git
				synced 2025-10-31 16:14:11 +01:00 
			
		
		
		
	Fixed bug JsonObjectBase::getNestedTokenCount() that reads uninitialized token
This commit is contained in:
		| @@ -10,15 +10,15 @@ using namespace ArduinoJson::Parser; | |||||||
|  |  | ||||||
| int JsonObjectBase::getNestedTokenCount(jsmntok_t* token) | int JsonObjectBase::getNestedTokenCount(jsmntok_t* token) | ||||||
| { | { | ||||||
|     int end = token->end; |     int tokensToVisit = token->size; | ||||||
|     int count = 0;	 |     int count = 0; | ||||||
|  |  | ||||||
|     token++; |     while (tokensToVisit) | ||||||
|  |  | ||||||
|     while (token->start < end) |  | ||||||
|     { |     { | ||||||
|         token++; |  | ||||||
|         count++; |         count++; | ||||||
|  |         token++; | ||||||
|  |         tokensToVisit--; | ||||||
|  |         tokensToVisit += token->size; | ||||||
|     } |     } | ||||||
|  |  | ||||||
|     return count; |     return count; | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user