1
0
Fork 0
mirror of git://git.code.sf.net/p/cdesktopenv/code synced 2025-03-09 15:50:02 +00:00

sh_funscope(): Fix possible dereference of null pointer

Patch from OpenSUSE:
https://build.opensuse.org/package/view_file/shells/ksh/ksh93-unset-f.dif
This commit is contained in:
Martijn Dekker 2021-01-28 04:38:48 +00:00
parent 129614b99f
commit c52cb93999

View file

@ -3120,7 +3120,8 @@ int sh_funscope(int argn, char *argv[],int(*fun)(void*),void *arg,int execflg)
shp->st.var_local = shp->var_tree;
if(!fun)
{
shp->st.filename = fp->node->nvalue.rp->fname;
if(fp->node->nvalue.rp)
shp->st.filename = fp->node->nvalue.rp->fname;
shp->st.funname = nv_name(fp->node);
shp->last_root = nv_dict(DOTSHNOD);
nv_putval(SH_PATHNAMENOD,shp->st.filename,NV_NOFREE);