OSDN Git Service

http: Make sure proxyauth is initialized
authorMartin Storsjö <martin@martin.st>
Thu, 1 Dec 2011 09:24:23 +0000 (11:24 +0200)
committerMartin Storsjö <martin@martin.st>
Thu, 1 Dec 2011 10:05:14 +0000 (12:05 +0200)
This string will be passed to ff_http_auth_create_response
even if no proxy is used, resulting in reading uninitialized
memory. The other auth string is always initialized by
av_url_split.

Signed-off-by: Martin Storsjö <martin@martin.st>
libavformat/http.c

index 63cfecd..a9b4d5a 100644 (file)
@@ -90,7 +90,7 @@ static int http_open_cnx(URLContext *h)
 {
     const char *path, *proxy_path, *lower_proto = "tcp", *local_path;
     char hostname[1024], hoststr[1024], proto[10];
-    char auth[1024], proxyauth[1024];
+    char auth[1024], proxyauth[1024] = "";
     char path1[1024];
     char buf[1024], urlbuf[1024];
     int port, use_proxy, err, location_changed = 0, redirects = 0;