webrtc_test: Fix crash when URL of '-c' option does not have port 80/278980/4
authorSangchul Lee <sc11.lee@samsung.com>
Thu, 28 Jul 2022 15:53:05 +0000 (00:53 +0900)
committerSangchul Lee <sc11.lee@samsung.com>
Fri, 29 Jul 2022 12:56:57 +0000 (21:56 +0900)
[Version] 0.3.182
[Issue Type] Crash fix

Change-Id: Ic09e1c7a4ee5bebcc6c9487bb8757aa27da7945d
Signed-off-by: Sangchul Lee <sc11.lee@samsung.com>
packaging/capi-media-webrtc.spec
test/webrtc_test.c

index f4b42daea4561d7d817bf89eae53abdf2404e408..dd98473e784a5310d6e7a517b8110ad405d4ca3c 100644 (file)
@@ -1,6 +1,6 @@
 Name:       capi-media-webrtc
 Summary:    A WebRTC library in Tizen Native API
-Version:    0.3.181
+Version:    0.3.182
 Release:    0
 Group:      Multimedia/API
 License:    Apache-2.0
index fb138960fe04c00b4a1838820cde5dccde9b5671..b76f1c5147280e9bd471c739563373a407baf333 100644 (file)
@@ -3868,10 +3868,15 @@ static int option_launch_signaling_server(int port)
 static int option_connect_signaling_server(char *url)
 {
        g_auto(GStrv) str_arr = g_strsplit((const gchar *)optarg, ":", 2);
+       if (g_strv_length(str_arr) == 1) {
+               g_printerr("port is missing\n");
+               return -1;
+       }
+
        g_print("%s %s\n", str_arr[0], str_arr[1]);
        if (g_str_has_prefix(str_arr[0], "wss") || g_str_has_prefix(str_arr[0], "ws")) {
                if (_setting_uri(g_ad.signaling_server.public.url, optarg) == -1) {
-                       g_print("invalid port number\n");
+                       g_printerr("invalid port number\n");
                        return -1;
                }
                if (_connect_signaling_server() == -1)