mirror of https://github.com/nealey/eris.git
Fix SEGV for dirindex of /. First bugfix, woo!
This commit is contained in:
parent
32714eb6c4
commit
db14145584
5
fnord.c
5
fnord.c
|
@ -1072,15 +1072,16 @@ static void
|
||||||
handledirlist(const char *origurl)
|
handledirlist(const char *origurl)
|
||||||
{
|
{
|
||||||
DIR *dir;
|
DIR *dir;
|
||||||
unsigned int nl = strlen(origurl);
|
unsigned int nl;
|
||||||
const char *nurl = origurl;
|
const char *nurl = origurl;
|
||||||
|
|
||||||
url = (char *) origurl;
|
url = (char *) origurl;
|
||||||
while (nurl[0] == '/')
|
while (nurl[0] == '/')
|
||||||
++nurl;
|
++nurl;
|
||||||
if (nurl <= origurl)
|
if (nurl <= origurl)
|
||||||
return;
|
return;
|
||||||
nl = strlen(nurl);
|
nl = strlen(nurl);
|
||||||
if (nurl[nl - 1] != '/')
|
if (nl && (nurl[nl - 1] != '/'))
|
||||||
return;
|
return;
|
||||||
if (!stat(nl ? nurl : ".", &st) && (S_ISDIR(st.st_mode))
|
if (!stat(nl ? nurl : ".", &st) && (S_ISDIR(st.st_mode))
|
||||||
&& ((st.st_mode & S_IRWXO) == 5)) {
|
&& ((st.st_mode & S_IRWXO) == 5)) {
|
||||||
|
|
Loading…
Reference in New Issue