Skip to content

Commit e911eb2

Browse files
committed
ConfigHandler\setFile(): validate the path passed to the function
1 parent 5238279 commit e911eb2

1 file changed

Lines changed: 8 additions & 6 deletions

File tree

modules/DependencyControl/ConfigHandler.moon

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -73,12 +73,14 @@ class ConfigHandler
7373
recurse @defaults
7474
@load! unless noLoad
7575

76-
setFile: (file) =>
77-
return false unless file
78-
if @@handlers[file]
79-
table.insert @@handlers[file], @
80-
else @@handlers[file] = {@}
81-
@file = file
76+
setFile: (path) =>
77+
return false unless path
78+
if @@handlers[path]
79+
table.insert @@handlers[path], @
80+
else @@handlers[path] = {@}
81+
path, err = fileOps.validateFullPath path, true
82+
return nil, err unless path
83+
@file = path
8284
return true
8385

8486
unsetFile: =>

0 commit comments

Comments
 (0)