Skip to content

Commit c52cb93

Browse files
committed
sh_funscope(): Fix possible dereference of null pointer
Patch from OpenSUSE: https://build.opensuse.org/package/view_file/shells/ksh/ksh93-unset-f.dif
1 parent 129614b commit c52cb93

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/cmd/ksh93/sh/xec.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3120,7 +3120,8 @@ int sh_funscope(int argn, char *argv[],int(*fun)(void*),void *arg,int execflg)
31203120
shp->st.var_local = shp->var_tree;
31213121
if(!fun)
31223122
{
3123-
shp->st.filename = fp->node->nvalue.rp->fname;
3123+
if(fp->node->nvalue.rp)
3124+
shp->st.filename = fp->node->nvalue.rp->fname;
31243125
shp->st.funname = nv_name(fp->node);
31253126
shp->last_root = nv_dict(DOTSHNOD);
31263127
nv_putval(SH_PATHNAMENOD,shp->st.filename,NV_NOFREE);

0 commit comments

Comments
 (0)