Commit b2b705aa authored by Daniel Cohen Gindi's avatar Daniel Cohen Gindi

Fail when NULL is passed to CreateFileListInfo()

Passing NULL to sprintf() would most likely crash the program.
parent fbf48c65
......@@ -109,8 +109,12 @@ CreateFileListInfo(FileListInfoPtr pFileListInfo, char* path, int flag)
{
DIR* pDir = NULL;
struct dirent* pDirent = NULL;
if((path == NULL) || (strlen(path) == 0)) {
if(path == NULL) {
return FAILURE;
}
if(strlen(path) == 0) {
/* In this case we will send the list of entries in ftp root*/
sprintf(path, "%s%s", GetFtpRoot(), "/");
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment