Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-1.1
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-1.1
Commits
5d0c2971
Commit
5d0c2971
authored
Sep 09, 2008
by
Laurent Aimar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed ftp segfault when no path is specified (close #2019)
parent
1d8f5517
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
modules/access/ftp.c
modules/access/ftp.c
+6
-6
No files found.
modules/access/ftp.c
View file @
5d0c2971
...
@@ -283,7 +283,7 @@ static int Connect( vlc_object_t *p_access, access_sys_t *p_sys )
...
@@ -283,7 +283,7 @@ static int Connect( vlc_object_t *p_access, access_sys_t *p_sys )
static
int
parseURL
(
vlc_url_t
*
url
,
const
char
*
path
)
static
int
parseURL
(
vlc_url_t
*
url
,
const
char
*
path
)
{
{
if
(
path
==
NULL
)
if
(
path
==
NULL
)
return
-
1
;
return
VLC_EGENERIC
;
/* *** Parse URL and get server addr/port and path *** */
/* *** Parse URL and get server addr/port and path *** */
while
(
*
path
==
'/'
)
while
(
*
path
==
'/'
)
...
@@ -292,7 +292,7 @@ static int parseURL( vlc_url_t *url, const char *path )
...
@@ -292,7 +292,7 @@ static int parseURL( vlc_url_t *url, const char *path )
vlc_UrlParse
(
url
,
path
,
0
);
vlc_UrlParse
(
url
,
path
,
0
);
if
(
url
->
psz_host
==
NULL
||
*
url
->
psz_host
==
'\0'
)
if
(
url
->
psz_host
==
NULL
||
*
url
->
psz_host
==
'\0'
)
return
-
1
;
return
VLC_EGENERIC
;
if
(
url
->
i_port
<=
0
)
if
(
url
->
i_port
<=
0
)
url
->
i_port
=
IPPORT_FTP
;
/* default port */
url
->
i_port
=
IPPORT_FTP
;
/* default port */
...
@@ -300,10 +300,10 @@ static int parseURL( vlc_url_t *url, const char *path )
...
@@ -300,10 +300,10 @@ static int parseURL( vlc_url_t *url, const char *path )
/* FTP URLs are relative to user's default directory (RFC1738)
/* FTP URLs are relative to user's default directory (RFC1738)
For absolute path use ftp://foo.bar//usr/local/etc/filename */
For absolute path use ftp://foo.bar//usr/local/etc/filename */
if
(
*
url
->
psz_path
==
'/'
)
if
(
url
->
psz_path
&&
*
url
->
psz_path
==
'/'
)
url
->
psz_path
++
;
url
->
psz_path
++
;
return
0
;
return
VLC_SUCCESS
;
}
}
...
@@ -328,7 +328,7 @@ static int InOpen( vlc_object_t *p_this )
...
@@ -328,7 +328,7 @@ static int InOpen( vlc_object_t *p_this )
goto
exit_error
;
goto
exit_error
;
/* get size */
/* get size */
if
(
ftp_SendCommand
(
p_this
,
p_sys
,
"SIZE %s"
,
p_sys
->
url
.
psz_path
)
<
0
||
if
(
ftp_SendCommand
(
p_this
,
p_sys
,
"SIZE %s"
,
p_sys
->
url
.
psz_path
?
:
""
)
<
0
||
ftp_ReadCommand
(
p_this
,
p_sys
,
NULL
,
&
psz_arg
)
!=
2
)
ftp_ReadCommand
(
p_this
,
p_sys
,
NULL
,
&
psz_arg
)
!=
2
)
{
{
msg_Err
(
p_access
,
"cannot get file size"
);
msg_Err
(
p_access
,
"cannot get file size"
);
...
@@ -762,7 +762,7 @@ static int ftp_StartStream( vlc_object_t *p_access, access_sys_t *p_sys,
...
@@ -762,7 +762,7 @@ static int ftp_StartStream( vlc_object_t *p_access, access_sys_t *p_sys,
/* "1xx" message */
/* "1xx" message */
if
(
ftp_SendCommand
(
p_access
,
p_sys
,
"%s %s"
,
if
(
ftp_SendCommand
(
p_access
,
p_sys
,
"%s %s"
,
p_sys
->
out
?
"STOR"
:
"RETR"
,
p_sys
->
out
?
"STOR"
:
"RETR"
,
p_sys
->
url
.
psz_path
)
<
0
||
p_sys
->
url
.
psz_path
?:
""
)
<
0
||
ftp_ReadCommand
(
p_access
,
p_sys
,
&
i_answer
,
NULL
)
>
2
)
ftp_ReadCommand
(
p_access
,
p_sys
,
&
i_answer
,
NULL
)
>
2
)
{
{
msg_Err
(
p_access
,
"cannot retrieve file"
);
msg_Err
(
p_access
,
"cannot retrieve 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