Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
GSoC
GSoC2018
macOS
vlc
Commits
356fafa5
Commit
356fafa5
authored
Oct 10, 2008
by
ivoire
Browse files
Fix potential buffer overflow (CID 191)
parent
eeaa54cf
Changes
1
Hide whitespace changes
Inline
Side-by-side
modules/misc/osd/simple.c
View file @
356fafa5
...
...
@@ -93,8 +93,11 @@ int osd_parser_simpleOpen( vlc_object_t *p_this )
/* NULL terminate before asking the length of path[] */
path
[
PATH_MAX
-
1
]
=
'\0'
;
i_len
=
strlen
(
&
path
[
0
]);
if
(
i_len
==
PATH_MAX
)
i_len
--
;
/* truncate to prevent buffer overflow */
/* Protect against 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
(
(
i_len
>
0
)
&&
path
[
i_len
]
!=
'\\'
)
path
[
i_len
]
=
'\\'
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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