]> granicus.if.org Git - curl/commitdiff
rtsp: ignore whitespace in session id
authorDaniel Stenberg <daniel@haxx.se>
Thu, 11 Aug 2016 09:37:00 +0000 (11:37 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Thu, 11 Aug 2016 12:02:12 +0000 (14:02 +0200)
Follow-up to e577c43bb to fix test case 569 brekage: stop the parser at
whitespace as well.

Help-by: Erik Janssen
lib/rtsp.c

index eb60ff78292095ca65b72140669ae18ad071f94a..ed3fd64c701914d744513c70693cde3799b665e2 100644 (file)
@@ -799,12 +799,12 @@ CURLcode Curl_rtsp_parseheader(struct connectdata *conn,
       /* If the Session ID is not set, and we find it in a response, then set
        * it.
        *
-       * Allow any content, up to the field seperator or end of line. RFC 2326
-       * isn't 100% clear on the session ID and for example gstreamer does
-       * url-encoded session ID's not covered by the standard.
+       * Allow any non whitespace content, up to the field seperator or end of
+       * line. RFC 2326 isn't 100% clear on the session ID and for example
+       * gstreamer does url-encoded session ID's not covered by the standard.
        */
       char *end = start;
-      while(*end && *end != ';')
+      while(*end && *end != ';' && !ISSPACE(*end))
         end++;
 
       /* Copy the id substring into a new buffer */