Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 516fdb9

Browse files
committed
Avoid to upload the web backdoor to unexisting empty-name directory
1 parent 24a3a23 commit 516fdb9

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

lib/core/common.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,8 @@ def getDirs():
285285
logger.info(infoMsg)
286286

287287
for absFilePath in kb.absFilePaths:
288-
directories.add(os.path.dirname(absFilePath))
288+
if absFilePath:
289+
directories.add(os.path.dirname(absFilePath))
289290
else:
290291
warnMsg = "unable to retrieve any web server path"
291292
logger.warn(warnMsg)
@@ -299,7 +300,8 @@ def getDirs():
299300
inputDirs = inputDirs.split(",")
300301

301302
for inputDir in inputDirs:
302-
directories.add(inputDir)
303+
if inputDir:
304+
directories.add(inputDir)
303305
else:
304306
directories.add(defaultDir)
305307

0 commit comments

Comments
 (0)