[vlc-commits] http: fix NULL deref if password is missing

Rémi Denis-Courmont git at videolan.org
Wed Oct 4 19:00:36 CEST 2017


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Wed Oct  4 20:00:06 2017 +0300| [adb8097716ac0c1fc4bb52313ce31d267e2fea40] | committer: Rémi Denis-Courmont

http: fix NULL deref if password is missing

Basic authentication requires both username and password.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=adb8097716ac0c1fc4bb52313ce31d267e2fea40
---

 modules/access/http/resource.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/modules/access/http/resource.c b/modules/access/http/resource.c
index dcaa0803b5..4f49a4bff6 100644
--- a/modules/access/http/resource.c
+++ b/modules/access/http/resource.c
@@ -58,7 +58,7 @@ vlc_http_res_req(const struct vlc_http_resource *res, void *opaque)
     }
 
     /* Authentication */
-    if (res->username != NULL)
+    if (res->username != NULL && res->password != NULL)
         vlc_http_msg_add_creds_basic(req, false, res->username, res->password);
 
     /* Request context */



More information about the vlc-commits mailing list