mirror of
git://git.code.sf.net/p/cdesktopenv/code
synced 2025-02-15 04:32:24 +00:00
cd: fix an invalid free() call (Solaris patch 211-21547336)
This change is pulled from here: https://github.com/oracle/solaris-userland/blob/master/components/ksh93/patches/211-21547336.patch src/cmd/ksh93/bltins/cd_pwd.c: b_cd(): - The functions path_pwd() and path_relative() in sh/path.c may return a pointer to e_dot[] (".") as a fallback if they fail to determine a path. This is a string in read-only memory (data/msg.c), so must not be freed. A pointer to that string may end up in sh.pwd (== shp->pwd), so b_cd() needs a check for that.
This commit is contained in:
parent
ad9ea0ba7d
commit
a3ccff6c75
1 changed files with 1 additions and 1 deletions
|
@ -212,7 +212,7 @@ success:
|
||||||
nv_scan(sh_subtracktree(1),rehash,(void*)0,NV_TAGGED,NV_TAGGED);
|
nv_scan(sh_subtracktree(1),rehash,(void*)0,NV_TAGGED,NV_TAGGED);
|
||||||
path_newdir(shp,shp->pathlist);
|
path_newdir(shp,shp->pathlist);
|
||||||
path_newdir(shp,shp->cdpathlist);
|
path_newdir(shp,shp->cdpathlist);
|
||||||
if(oldpwd)
|
if(oldpwd && oldpwd!=e_dot)
|
||||||
free(oldpwd);
|
free(oldpwd);
|
||||||
return(0);
|
return(0);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue