Skip to content

Commit

Permalink
sh_funscope(): Fix possible dereference of null pointer
Browse files Browse the repository at this point in the history
  • Loading branch information
McDutchie committed Jan 28, 2021
1 parent 129614b commit c52cb93
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/cmd/ksh93/sh/xec.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit c52cb93

Please sign in to comment.