diff mbox series

[FFmpeg-devel] avformat/http: set hostname and lower_url buffer size properly

Message ID tencent_A8D4E0F45A3434A3805C34D93E1156DB9C09@qq.com
State New
Headers show
Series [FFmpeg-devel] avformat/http: set hostname and lower_url buffer size properly
Related show

Checks

Context Check Description
andriy/default pending
andriy/make success Make finished
andriy/make_fate success Make fate finished

Commit Message

zhilizhao(赵志立) Aug. 24, 2020, 3:10 p.m. UTC
1. The buffer size of lower_url shouldn't be smaller than hostname
2. The maximum length of a DNS name is 255 octets
---
 libavformat/http.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

zhilizhao(赵志立) Sept. 26, 2020, 4:30 p.m. UTC | #1
Ping for review, thanks.

> On Aug 24, 2020, at 11:10 PM, Zhao Zhili <quinkblack@foxmail.com> wrote:
> 
> 1. The buffer size of lower_url shouldn't be smaller than hostname
> 2. The maximum length of a DNS name is 255 octets
> ---
> libavformat/http.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/libavformat/http.c b/libavformat/http.c
> index 3d25d652d3..9c40a82a5b 100644
> --- a/libavformat/http.c
> +++ b/libavformat/http.c
> @@ -525,8 +525,8 @@ static int http_listen(URLContext *h, const char *uri, int flags,
>                        AVDictionary **options) {
>     HTTPContext *s = h->priv_data;
>     int ret;
> -    char hostname[1024], proto[10];
> -    char lower_url[100];
> +    char hostname[256], proto[10];
> +    char lower_url[512];
>     const char *lower_proto = "tcp";
>     int port;
>     av_url_split(proto, sizeof(proto), NULL, 0, hostname, sizeof(hostname), &port,
> -- 
> 2.25.1
>
diff mbox series

Patch

diff --git a/libavformat/http.c b/libavformat/http.c
index 3d25d652d3..9c40a82a5b 100644
--- a/libavformat/http.c
+++ b/libavformat/http.c
@@ -525,8 +525,8 @@  static int http_listen(URLContext *h, const char *uri, int flags,
                        AVDictionary **options) {
     HTTPContext *s = h->priv_data;
     int ret;
-    char hostname[1024], proto[10];
-    char lower_url[100];
+    char hostname[256], proto[10];
+    char lower_url[512];
     const char *lower_proto = "tcp";
     int port;
     av_url_split(proto, sizeof(proto), NULL, 0, hostname, sizeof(hostname), &port,