Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc
Commits
4768fb3d
Commit
4768fb3d
authored
Dec 31, 2015
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
skins2: fix ToCToU
parent
04706d48
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
8 deletions
+2
-8
modules/gui/skins2/x11/x11_factory.cpp
modules/gui/skins2/x11/x11_factory.cpp
+2
-8
No files found.
modules/gui/skins2/x11/x11_factory.cpp
View file @
4768fb3d
...
...
@@ -24,9 +24,9 @@
#ifdef X11_SKINS
#include <errno.h>
#include <unistd.h>
#include <dirent.h>
#include <sys/stat.h>
#include <X11/Xlib.h>
#include <X11/extensions/Xinerama.h>
...
...
@@ -349,7 +349,6 @@ void X11Factory::rmDir( const std::string &rPath )
// Parse the directory and remove everything it contains
while
(
(
file
=
readdir
(
dir
))
)
{
struct
stat
statbuf
;
std
::
string
filename
=
file
->
d_name
;
// Skip "." and ".."
...
...
@@ -360,12 +359,7 @@ void X11Factory::rmDir( const std::string &rPath )
filename
=
rPath
+
"/"
+
filename
;
if
(
!
stat
(
filename
.
c_str
(),
&
statbuf
)
&&
statbuf
.
st_mode
&
S_IFDIR
)
{
rmDir
(
filename
);
}
else
{
if
(
rmdir
(
filename
.
c_str
()
)
&&
errno
==
ENOTDIR
)
unlink
(
filename
.
c_str
()
);
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment