diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-06-04 13:56:01 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-06-04 13:56:07 +0200 |
commit | 372e00793fe8b9a22cf9ebb8b1e1147db4ee4c6b (patch) | |
tree | 4ddbc3e8d4ee70ea6923f18d0ee283fc02ad0d7a | |
parent | 2192f89368d837a4d960a1cabf5475fdeff697e7 (diff) | |
parent | 7faafe606fb25e3c8b3091ea0565b01622c87dd2 (diff) | |
download | ffmpeg-372e00793fe8b9a22cf9ebb8b1e1147db4ee4c6b.tar.gz |
Merge remote-tracking branch 'lukaszmluki/master'
* lukaszmluki/master:
ftp: fix using uninitialized value
Merged-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | libavformat/ftp.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/libavformat/ftp.c b/libavformat/ftp.c index cd3006b495..faa82dd30d 100644 --- a/libavformat/ftp.c +++ b/libavformat/ftp.c @@ -265,7 +265,7 @@ static int ftp_auth(FTPContext *s) static int ftp_passive_mode(FTPContext *s) { - char *res = NULL, *start, *end; + char *res = NULL, *start = NULL, *end = NULL; int i; const char *command = "PASV\r\n"; const int pasv_codes[] = {227, 501, 0}; /* 501 is incorrect code */ @@ -273,8 +273,7 @@ static int ftp_passive_mode(FTPContext *s) if (ftp_send_command(s, command, pasv_codes, &res) != 227 || !res) goto fail; - start = NULL; - for (i = 0; i < strlen(res); ++i) { + for (i = 0; res[i]; ++i) { if (res[i] == '(') { start = res + i + 1; } else if (res[i] == ')') { |