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
d479ed1b
Commit
d479ed1b
authored
Jan 21, 2011
by
Jean-Philippe André
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Zip: check memory allocations or fail (in Open)
parent
fe6f4ad0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
1 deletion
+17
-1
modules/access/zip/zipaccess.c
modules/access/zip/zipaccess.c
+17
-1
No files found.
modules/access/zip/zipaccess.c
View file @
d479ed1b
...
...
@@ -128,16 +128,31 @@ int AccessOpen( vlc_object_t *p_this )
msg_Dbg
(
p_access
,
"not an encoded URL Trying file '%s'"
,
psz_path
);
psz_pathToZip
=
strdup
(
psz_path
);
if
(
!
psz_pathToZip
)
{
i_ret
=
VLC_ENOMEM
;
goto
exit
;
}
}
p_sys
->
psz_fileInzip
=
unescapeXml
(
psz_sep
+
ZIP_SEP_LEN
);
if
(
!
p_sys
->
psz_fileInzip
)
{
p_sys
->
psz_fileInzip
=
strdup
(
psz_sep
+
ZIP_SEP_LEN
);
if
(
!
p_sys
->
psz_fileInzip
)
{
i_ret
=
VLC_ENOMEM
;
goto
exit
;
}
}
/* Define IO functions */
zlib_filefunc_def
*
p_func
=
(
zlib_filefunc_def
*
)
calloc
(
1
,
sizeof
(
zlib_filefunc_def
)
);
if
(
!
p_func
)
{
i_ret
=
VLC_ENOMEM
;
goto
exit
;
}
p_func
->
zopen_file
=
ZipIO_Open
;
p_func
->
zread_file
=
ZipIO_Read
;
p_func
->
zwrite_file
=
ZipIO_Write
;
// see comment
...
...
@@ -375,7 +390,8 @@ static void* ZCALLBACK ZipIO_Open( void* opaque, const char* file, int mode )
access_t
*
p_access
=
(
access_t
*
)
opaque
;
char
*
fileUri
=
malloc
(
strlen
(
file
)
+
8
);
if
(
!
fileUri
)
return
VLC_ENOMEM
;
if
(
!
fileUri
)
return
NULL
;
if
(
!
strstr
(
file
,
"://"
)
)
{
strcpy
(
fileUri
,
"file://"
);
...
...
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