mirror of
git://git.code.sf.net/p/cdesktopenv/code
synced 2025-03-09 15:50:02 +00:00
fix non-null pointer check (re: b7932e87
)
src/cmd/ksh93/sh/xec.c: sh_funct(): - The np->nvalue.rp pointer was dereferenced before the check that it is non-null. Do this check before dereferencing it.
This commit is contained in:
parent
352e68dabd
commit
c382cea176
1 changed files with 7 additions and 4 deletions
|
@ -3234,11 +3234,14 @@ static void sh_funct(Shell_t *shp,Namval_t *np,int argn, char *argv[],struct arg
|
|||
nv_putval(SH_FUNNAMENOD,fname,NV_NOFREE);
|
||||
nv_putval(SH_PATHNAMENOD,shp->st.filename,NV_NOFREE);
|
||||
shp->pipepid = pipepid;
|
||||
np->nvalue.rp->running -= 2;
|
||||
if(np->nvalue.rp && np->nvalue.rp->running==1)
|
||||
if(np->nvalue.rp)
|
||||
{
|
||||
np->nvalue.rp->running = 0;
|
||||
_nv_unset(np, NV_RDONLY);
|
||||
np->nvalue.rp->running -= 2;
|
||||
if(np->nvalue.rp->running==1)
|
||||
{
|
||||
np->nvalue.rp->running = 0;
|
||||
_nv_unset(np, NV_RDONLY);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue