mirror of
https://github.com/warmcat/libwebsockets.git
synced 2025-03-30 00:00:16 +01:00
coverity 169274 - lwsgt dirlisting ignore files that cant be statted
This commit is contained in:
parent
01020b60f6
commit
d11bee7fc5
1 changed files with 4 additions and 3 deletions
|
@ -123,7 +123,7 @@ scan_dir(struct lws *wsi, struct per_session_data__tbl_dir *pss)
|
||||||
|
|
||||||
if (stat(path, &st)) {
|
if (stat(path, &st)) {
|
||||||
lwsl_info("unable to stat %s\n", path);
|
lwsl_info("unable to stat %s\n", path);
|
||||||
goto bail;
|
continue;
|
||||||
}
|
}
|
||||||
f = malloc(sizeof(*f));
|
f = malloc(sizeof(*f));
|
||||||
f->next = NULL;
|
f->next = NULL;
|
||||||
|
@ -142,8 +142,10 @@ scan_dir(struct lws *wsi, struct per_session_data__tbl_dir *pss)
|
||||||
if (f->uri)
|
if (f->uri)
|
||||||
pss->p += n + 1;
|
pss->p += n + 1;
|
||||||
|
|
||||||
if (end - pss->p < 100)
|
if (end - pss->p < 100) {
|
||||||
|
free(f);
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
icon = " ";
|
icon = " ";
|
||||||
if ((S_IFMT & st.st_mode) == S_IFDIR)
|
if ((S_IFMT & st.st_mode) == S_IFDIR)
|
||||||
|
@ -165,7 +167,6 @@ scan_dir(struct lws *wsi, struct per_session_data__tbl_dir *pss)
|
||||||
prev = f;
|
prev = f;
|
||||||
}
|
}
|
||||||
|
|
||||||
bail:
|
|
||||||
uv_fs_req_cleanup(&req);
|
uv_fs_req_cleanup(&req);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
|
Loading…
Add table
Reference in a new issue