vlc/vlc-3.0 | branch: master | Hugo Beauzée-Luyssen <[email protected]> | Wed Jun 27 11:16:56 2018 +0200| [74297b7d44a14703dc9827d2bd837da463d45421] | committer: Hugo Beauzée-Luyssen
httpd: Fix leak in case of dubious requet headers (cherry picked from commit 80e6e93afa4001d0c3df988ecec13fdc86282cc6) Signed-off-by: Hugo Beauzée-Luyssen <[email protected]> > http://git.videolan.org/gitweb.cgi/vlc/vlc-3.0.git/?a=commit;h=74297b7d44a14703dc9827d2bd837da463d45421 --- src/network/httpd.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/network/httpd.c b/src/network/httpd.c index f0790694ff..149ff6e111 100644 --- a/src/network/httpd.c +++ b/src/network/httpd.c @@ -1455,10 +1455,12 @@ static void httpd_ClientRecv(httpd_client_t *cl) } } - cl->query.psz_url = strdup(p); - if ((p3 = strchr(cl->query.psz_url, '?')) ) { - *p3++ = '\0'; - cl->query.psz_args = (uint8_t *)strdup(p3); + if(cl->query.psz_url == NULL) { + cl->query.psz_url = strdup(p); + if ((p3 = strchr(cl->query.psz_url, '?')) ) { + *p3++ = '\0'; + cl->query.psz_args = (uint8_t *)strdup(p3); + } } p = p2; } _______________________________________________ vlc-commits mailing list [email protected] https://mailman.videolan.org/listinfo/vlc-commits
