Re: [PATCH] readline: Fix possible array index out of bounds in readline_hist_add()

2020-12-17 Thread Stefan Hajnoczi
On Thu, Dec 03, 2020 at 01:50:43PM +, Alex Chen wrote: > When the 'cmdline' is the last entry in 'rs->history' array, there is > no need to put this entry to the end of the array, partly because it is > the last entry, and partly because the next operition will lead to array > index out of boun

[PATCH] readline: Fix possible array index out of bounds in readline_hist_add()

2020-12-03 Thread Alex Chen
When the 'cmdline' is the last entry in 'rs->history' array, there is no need to put this entry to the end of the array, partly because it is the last entry, and partly because the next operition will lead to array index out of bounds. Reported-by: Euler Robot Signed-off-by: Alex Chen --- util/