mirror of
git://git.code.sf.net/p/cdesktopenv/code
synced 2025-02-13 11:42:21 +00:00
Fix one buffer overflow in 'typeset -p .sh.type' (#457)
This small commit replaces one instance of memcmp with strncmp to fix one of the buffer overflows that causes 'typeset -p .sh.type' to crash (see also https://github.com/ksh93/ksh/issues/456).
This commit is contained in:
parent
f38494ea1d
commit
a00fe6b7fd
1 changed files with 1 additions and 1 deletions
|
@ -1473,7 +1473,7 @@ int sh_outtype(Sfio_t *out)
|
|||
{
|
||||
if(nv_isnull(tp) || !nv_isvtree(tp))
|
||||
continue;
|
||||
if(indent && (memcmp(tp->nvname,sh.prefix,n-1) || tp->nvname[n-1]!='.' || strchr(tp->nvname+n,'.')))
|
||||
if(indent && (strncmp(tp->nvname,sh.prefix,n-1) || tp->nvname[n-1]!='.' || strchr(tp->nvname+n,'.')))
|
||||
continue;
|
||||
nv_settype(L_ARGNOD,tp,0);
|
||||
if(indent)
|
||||
|
|
Loading…
Reference in a new issue