mirror of
git://git.code.sf.net/p/cdesktopenv/code
synced 2025-03-09 15:50:02 +00:00
Fix more bugs that occur when enabling ASan (#293)
src/cmd/ksh93/{bltins/typeset,sh/name,sh/nvtree,sh/nvtype}.c:
- Replace more instances of memcmp with strncmp to fix
heap-buffer-overflow errors when running the regression tests
with ASan enabled.
src/cmd/ksh93/edit/vi.c:
- Fix an invalid dereference of the 'p' pointer to fix a crash in
vi mode when entering a comment in the command history. This
bugfix was backported from ksh2020:
https://github.com/att/ast/issues/798
src/cmd/ksh93/tests/pty.sh:
- Add a regression test for the vi mode crash.
This commit is contained in:
parent
88a1f3d661
commit
1aec9b06dd
6 changed files with 20 additions and 5 deletions
|
|
@ -1581,7 +1581,7 @@ static void print_scan(Sfio_t *file, int flag, Dt_t *root, int option,struct tda
|
|||
if(name)
|
||||
{
|
||||
char *newname = nv_name(np);
|
||||
if(memcmp(name,newname,len)==0 && newname[len]== '.')
|
||||
if(strncmp(name,newname,len)==0 && newname[len]== '.')
|
||||
continue;
|
||||
name = 0;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue