Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffmpeg.wasm-core
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
ffmpeg.wasm-core
Commits
04f1d497
Commit
04f1d497
authored
Feb 05, 2020
by
Marton Balint
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avformat/ftp: do not break protocol on username or password with newlines
Signed-off-by:
Marton Balint
<
cus@passwd.hu
>
parent
f204a38e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
0 deletions
+6
-0
ftp.c
libavformat/ftp.c
+6
-0
No files found.
libavformat/ftp.c
View file @
04f1d497
...
...
@@ -18,6 +18,8 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <string.h>
#include "libavutil/avstring.h"
#include "libavutil/internal.h"
#include "libavutil/parseutils.h"
...
...
@@ -246,10 +248,14 @@ static int ftp_auth(FTPContext *s)
static
const
int
user_codes
[]
=
{
331
,
230
,
0
};
static
const
int
pass_codes
[]
=
{
230
,
0
};
if
(
strpbrk
(
s
->
user
,
"
\r\n
"
))
return
AVERROR
(
EINVAL
);
snprintf
(
buf
,
sizeof
(
buf
),
"USER %s
\r\n
"
,
s
->
user
);
err
=
ftp_send_command
(
s
,
buf
,
user_codes
,
NULL
);
if
(
err
==
331
)
{
if
(
s
->
password
)
{
if
(
strpbrk
(
s
->
password
,
"
\r\n
"
))
return
AVERROR
(
EINVAL
);
snprintf
(
buf
,
sizeof
(
buf
),
"PASS %s
\r\n
"
,
s
->
password
);
err
=
ftp_send_command
(
s
,
buf
,
pass_codes
,
NULL
);
}
else
...
...
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