Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
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-2-2
Commits
3dfba478
Commit
3dfba478
authored
Jan 09, 2014
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vlc_readdir: fix integer overflow on error
parent
2683bad6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
src/posix/filesystem.c
src/posix/filesystem.c
+2
-2
No files found.
src/posix/filesystem.c
View file @
3dfba478
...
@@ -158,9 +158,9 @@ char *vlc_readdir( DIR *dir )
...
@@ -158,9 +158,9 @@ char *vlc_readdir( DIR *dir )
long
len
=
fpathconf
(
dirfd
(
dir
),
_PC_NAME_MAX
);
long
len
=
fpathconf
(
dirfd
(
dir
),
_PC_NAME_MAX
);
/* POSIX says there shall we room for NAME_MAX bytes at all times */
/* POSIX says there shall we room for NAME_MAX bytes at all times */
if
(
/*len == -1 ||*/
len
<
NAME_MAX
)
if
(
len
==
-
1
||
len
<
NAME_MAX
)
len
=
NAME_MAX
;
len
=
NAME_MAX
;
len
+=
offsetof
(
struct
dirent
,
d_name
)
+
1
;
len
+=
sizeof
(
*
ent
)
+
1
-
sizeof
(
ent
->
d_name
)
;
struct
dirent
*
buf
=
malloc
(
len
);
struct
dirent
*
buf
=
malloc
(
len
);
if
(
unlikely
(
buf
==
NULL
))
if
(
unlikely
(
buf
==
NULL
))
...
...
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