]> xenbits.xensource.com Git - people/andrewcoop/qemu-traditional.git/commit
readline: fix memory corruption when adding history
authorKaifeng Zhu <kaifeng.zhu@citrix.com>
Fri, 7 Mar 2014 09:50:41 +0000 (09:50 +0000)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Fri, 16 Oct 2015 15:52:06 +0000 (16:52 +0100)
commit1b10783fe24c7c5f22320032e0d4da5aab9da572
tree67182e2de694ea732b315a8f59bd0873f77518c7
parenta4d48935c97839337f6aa8b2bb944e92bb9909df
readline: fix memory corruption when adding history

idx can be down to 0, so TERM_MAX_CMDS-idx+1 could be TERM_MAX_CMDS+1, which
exceeds the size of term_history.

Signed-off-by: Kaifeng Zhu <kaifeng.zhu@citrix.com>
Coverity-ID: 1055739
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
readline.c