$NetBSD: patch-au,v 1.10.2.2 2011/10/20 01:47:40 tron Exp $

VideoLAN-SA-1107

--- src/network/httpd.c.orig	2010-12-23 13:26:53.000000000 +0000
+++ src/network/httpd.c
@@ -1755,16 +1755,27 @@ static void httpd_ClientRecv( httpd_clie
                             *p2++ = '\0';
                         }
                         if( !strncasecmp( p, ( cl->query.i_proto
-                                   == HTTPD_PROTO_HTTP ) ? "http" : "rtsp", 4 )
-                         && p[4 + !!strchr( "sS", p[4] )] == ':' )
+                             == HTTPD_PROTO_HTTP ) ? "http" : "rtsp", 5 ) )
                         {   /* Skip hier-part of URL (if present) */
-                            p = strchr( p, ':' ) + 1; /* skip URI scheme */
+			    p += 5;
                             if( !strncmp( p, "//", 2 ) ) /* skip authority */
                             {   /* see RFC3986 §3.2 */
                                 p += 2;
-                                while( *p && !strchr( "/?#", *p ) ) p++;
+				p += strcspn( p, "/?#" );
                             }
                         }
+			else
+			if( !strncasecmp( p, ( cl->query.i_proto
+			     == HTTPD_PROTO_HTTP ) ? "https:" : "rtsps:", 6 ) )
+			{   /* Skip hier-part of URL (if present) */
+			    p += 6;
+			    if( !strncmp( p, "//", 2 ) ) /* skip authority */
+			    {   /* see RFC3986 ?3.2 */
+				p += 2;
+				p += strcspn( p, "/?#" );
+			    }
+			}
+
                         cl->query.psz_url = strdup( p );
                         if( ( p3 = strchr( cl->query.psz_url, '?' ) )  )
                         {
