[vlc-commits] httprequests.lua: return ".." instead of silent directory listing failure
Pierre Ynard
git at videolan.org
Tue Aug 18 17:18:40 CEST 2020
vlc/vlc-3.0 | branch: master | Pierre Ynard <linkfanel at yahoo.fr> | Tue Aug 18 17:05:34 2020 +0200| [a294182240a72e78a19b060dced99042b1396dbe] | committer: Pierre Ynard
httprequests.lua: return ".." instead of silent directory listing failure
Refs #5075, #25021
(cherry picked from commit dc8da491eb33aa3508950662541ed755aa983ee6)
Signed-off-by: Pierre Ynard <linkfanel at yahoo.fr>
> http://git.videolan.org/gitweb.cgi/vlc/vlc-3.0.git/?a=commit;h=a294182240a72e78a19b060dced99042b1396dbe
---
share/lua/intf/modules/httprequests.lua | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/share/lua/intf/modules/httprequests.lua b/share/lua/intf/modules/httprequests.lua
index b4cb7e16e2..77fde2d866 100644
--- a/share/lua/intf/modules/httprequests.lua
+++ b/share/lua/intf/modules/httprequests.lua
@@ -409,6 +409,12 @@ getbrowsetable = function ()
local d = vlc.net.opendir(dir)
table.sort(d)
+ --FIXME: this is the wrong place to do this, but this still offers
+ --some useful mitigation: see #25021
+ if #d == 0 and dir ~= "" then
+ table.insert(d, "..")
+ end
+
for _,f in pairs(d) do
if f == ".." or not string.match(f,"^%.") then
local path = dir..f
More information about the vlc-commits
mailing list