fix bug exhibited by t0000-basic.sh introduced in R38 shortly before the
release: sometimes, a “cd -P” would cause memory corruption because lalloc internal data was overwritten due to accidentally losing a “continue;”
This commit is contained in:
12
misc.c
12
misc.c
@ -29,7 +29,7 @@
|
||||
#include <grp.h>
|
||||
#endif
|
||||
|
||||
__RCSID("$MirOS: src/bin/mksh/misc.c,v 1.107 2009/05/27 09:58:23 tg Exp $");
|
||||
__RCSID("$MirOS: src/bin/mksh/misc.c,v 1.108 2009/05/31 15:10:07 tg Exp $");
|
||||
|
||||
#undef USE_CHVT
|
||||
#if defined(TIOCSCTTY) && !defined(MKSH_SMALL)
|
||||
@ -1331,11 +1331,11 @@ do_phys_path(XString *xsp, char *xp, const char *pathl)
|
||||
|
||||
llen = readlink(Xstring(*xsp, xp), lbuf, PATH_MAX - 1);
|
||||
if (llen < 0) {
|
||||
/* EINVAL means it wasn't a symlink... */
|
||||
if (errno != EINVAL) {
|
||||
xp = NULL;
|
||||
goto out;
|
||||
}
|
||||
if (errno == EINVAL)
|
||||
/* not a symbolic link */
|
||||
continue;
|
||||
xp = NULL;
|
||||
goto out;
|
||||
}
|
||||
lbuf[llen] = '\0';
|
||||
|
||||
|
Reference in New Issue
Block a user