aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Dong <jdong@google.com>2010-02-10 14:38:56 -0800
committerJames Dong <jdong@google.com>2010-02-10 14:41:05 -0800
commit1faa812192c806b416323ff49877a97b009d0f47 (patch)
treecc9b028c97a2abe2eb639ecffed35bd52d9bf9ff
parentee9fc344d12e5e1164e29e93e2e8bf244ce0272f (diff)
downloadopencore-1faa812192c806b416323ff49877a97b009d0f47.tar.gz
Fix for URL parsing which may mistreat :pass as :port
bug - 2317216
-rw-r--r--protocols/rtsp_client_engine/src/pvrtsp_client_engine_node.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/protocols/rtsp_client_engine/src/pvrtsp_client_engine_node.cpp b/protocols/rtsp_client_engine/src/pvrtsp_client_engine_node.cpp
index 1d4142690..b5bcbd2c1 100644
--- a/protocols/rtsp_client_engine/src/pvrtsp_client_engine_node.cpp
+++ b/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';