projects
/
profile
/
ivi
/
syslinux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e7685ec
)
rosh: Fix rosh_ls_arg() to prevent segfault on access denied
author
Gene Cumm
<gene.cumm@gmail.com>
Sat, 2 Oct 2010 04:13:38 +0000
(
00:13
-0400)
committer
Gene Cumm
<gene.cumm@gmail.com>
Sat, 9 Oct 2010 11:33:07 +0000
(07:33 -0400)
com32/rosh/rosh.c
patch
|
blob
|
history
diff --git
a/com32/rosh/rosh.c
b/com32/rosh/rosh.c
index
bed75cc
..
8d4b501
100644
(file)
--- a/
com32/rosh/rosh.c
+++ b/
com32/rosh/rosh.c
@@
-779,7
+779,12
@@
void rosh_ls_arg(const char *filestr, const int *optarr)
if (S_ISDIR(fdstat.st_mode)) {
ROSH_DEBUG("PATH '%s' is a directory\n", filestr);
d = opendir(filestr);
- rosh_ls_arg_dir(filestr, d, optarr);
+ if (d) {
+ rosh_ls_arg_dir(filestr, d, optarr);
+ } else {
+ rosh_error(errno, "ls", filestr);
+ errno = 0;
+ }
closedir(d);
} else {
de.d_ino = rosh_ls_d_ino(&fdstat);