Re: [Qemu-devel] [PATCH] json: Fix off-by-one assert check in next_state()

2019-03-21 Thread Stefano Garzarella
On Thu, Mar 21, 2019 at 11:57:52AM +, Liam Merwick wrote: > The assert checking if the value of lexer->state in next_state(), > which is used as an index to the 'json_lexer' array, incorrectly > checks for an index value less than or equal to ARRAY_SIZE(json_lexer). > Fix assert so that it just

Re: [Qemu-devel] [PATCH] json: Fix off-by-one assert check in next_state()

2019-03-21 Thread Markus Armbruster
Liam Merwick writes: > The assert checking if the value of lexer->state in next_state(), > which is used as an index to the 'json_lexer' array, incorrectly > checks for an index value less than or equal to ARRAY_SIZE(json_lexer). > Fix assert so that it just checks for an index less than the arra

Re: [Qemu-devel] [PATCH] json: Fix off-by-one assert check in next_state()

2019-03-21 Thread Li Qiang
Liam Merwick 于2019年3月21日周四 下午8:04写道: > The assert checking if the value of lexer->state in next_state(), > which is used as an index to the 'json_lexer' array, incorrectly > checks for an index value less than or equal to ARRAY_SIZE(json_lexer). > Fix assert so that it just checks for an index le

[Qemu-devel] [PATCH] json: Fix off-by-one assert check in next_state()

2019-03-21 Thread Liam Merwick
The assert checking if the value of lexer->state in next_state(), which is used as an index to the 'json_lexer' array, incorrectly checks for an index value less than or equal to ARRAY_SIZE(json_lexer). Fix assert so that it just checks for an index less than the array size. Signed-off-by: Liam Me