mirror of
https://gitee.com/xia-chu/ZLMediaKit.git
synced 2026-05-20 00:37:49 +08:00
修复访问野指针的问题:#146
This commit is contained in:
parent
e6d511cc9e
commit
083933cbad
@ -433,8 +433,9 @@ static string findIndexFile(const string &dir){
|
|||||||
while ((pDirent = readdir(pDir)) != NULL) {
|
while ((pDirent = readdir(pDir)) != NULL) {
|
||||||
static set<const char *,StrCaseCompare> indexSet = {"index.html","index.htm","index"};
|
static set<const char *,StrCaseCompare> indexSet = {"index.html","index.htm","index"};
|
||||||
if(indexSet.find(pDirent->d_name) != indexSet.end()){
|
if(indexSet.find(pDirent->d_name) != indexSet.end()){
|
||||||
|
string ret = pDirent->d_name;
|
||||||
closedir(pDir);
|
closedir(pDir);
|
||||||
return pDirent->d_name;
|
return ret;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
closedir(pDir);
|
closedir(pDir);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user