Re: [PATCH] lib: Verify array index is correct before using it

2020-07-23 Thread Randy Dunlap
On 7/23/20 6:48 AM, Huang Guobin wrote: > This code reads from the array before verifying that "c" is a valid > index. Move test array offset code before use to fix it. > > Fixes: 2da572c959dd ("lib: add software 842 compression/decompression") > Signed-off-by: Huang Guobin Hi, Why shouldn't the

[PATCH] lib: Verify array index is correct before using it

2020-07-23 Thread Huang Guobin
This code reads from the array before verifying that "c" is a valid index. Move test array offset code before use to fix it. Fixes: 2da572c959dd ("lib: add software 842 compression/decompression") Signed-off-by: Huang Guobin --- lib/842/842_compress.c | 7 +-- 1 file changed, 5 insertions(+)