Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix for URL parsing which may mistreat :pass as :port

bug - 2317216
  • Loading branch information...
commit 1faa812192c806b416323ff49877a97b009d0f47 1 parent ee9fc34
James Dong authored
Showing with 8 additions and 0 deletions.
  1. +8 −0 protocols/rtsp_client_engine/src/pvrtsp_client_engine_node.cpp
View
8 protocols/rtsp_client_engine/src/pvrtsp_client_engine_node.cpp
@@ -2365,8 +2365,16 @@ bool PVRTSPEngineNode::parseURL(const char *aUrl)
server_ip_ptr += 2;
/* Locate the server name. */
+ /* URL spec: proto://[user[:pass]@]server[:port][[/path/to]/resource] */
mbchar *server_port_ptr = OSCL_CONST_CAST(mbchar*, oscl_strstr(server_ip_ptr, ":"));
mbchar *clip_name = OSCL_CONST_CAST(mbchar*, oscl_strstr(server_ip_ptr, "/"));
+ mbchar *at_ptr = OSCL_CONST_CAST(mbchar*, oscl_strstr(server_ip_ptr, "@"));
+ if (at_ptr > server_port_ptr && // "@" is found
+ (!clip_name || // no "/" is found
+ at_ptr < clip_name)) { // both "@" and "/" are found
+ // We just found :pass, not :port; search for :port after :pass
+ server_port_ptr = OSCL_CONST_CAST(mbchar*, oscl_strstr(at_ptr, ":"));
+ }
if (clip_name != NULL)
{
*clip_name++ = '\0';
Please sign in to comment.
Something went wrong with that request. Please try again.