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
356fafa5
Commit
356fafa5
authored
Oct 10, 2008
by
Rémi Duraffort
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix potential buffer overflow (CID 191)
parent
eeaa54cf
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
2 deletions
+5
-2
modules/misc/osd/simple.c
modules/misc/osd/simple.c
+5
-2
No files found.
modules/misc/osd/simple.c
View file @
356fafa5
...
@@ -93,8 +93,11 @@ int osd_parser_simpleOpen( vlc_object_t *p_this )
...
@@ -93,8 +93,11 @@ int osd_parser_simpleOpen( vlc_object_t *p_this )
/* NULL terminate before asking the length of path[] */
/* NULL terminate before asking the length of path[] */
path
[
PATH_MAX
-
1
]
=
'\0'
;
path
[
PATH_MAX
-
1
]
=
'\0'
;
i_len
=
strlen
(
&
path
[
0
]);
i_len
=
strlen
(
&
path
[
0
]);
if
(
i_len
==
PATH_MAX
)
/* Protect against buffer overflow:
i_len
--
;
/* truncate to prevent buffer overflow */
* max index is PATH_MAX-1 and we increment by 1 after
* so PATH_MAX-2 is the bigest we can have */
if
(
i_len
>
PATH_MAX
-
2
)
i_len
=
PATH_MAX
-
2
;
#if defined(WIN32) || defined(UNDER_CE)
#if defined(WIN32) || defined(UNDER_CE)
if
(
(
i_len
>
0
)
&&
path
[
i_len
]
!=
'\\'
)
if
(
(
i_len
>
0
)
&&
path
[
i_len
]
!=
'\\'
)
path
[
i_len
]
=
'\\'
;
path
[
i_len
]
=
'\\'
;
...
...
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