From: Sangchul Lee Date: Thu, 28 Jul 2022 15:53:05 +0000 (+0900) Subject: webrtc_test: Fix crash when URL of '-c' option does not have port X-Git-Tag: submit/tizen/20220802.115810~7 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=10d44a1f54a63e927488c5da75d292ce395a3bb9;p=platform%2Fcore%2Fapi%2Fwebrtc.git webrtc_test: Fix crash when URL of '-c' option does not have port [Version] 0.3.182 [Issue Type] Crash fix Change-Id: Ic09e1c7a4ee5bebcc6c9487bb8757aa27da7945d Signed-off-by: Sangchul Lee --- diff --git a/packaging/capi-media-webrtc.spec b/packaging/capi-media-webrtc.spec index f4b42dae..dd98473e 100644 --- a/packaging/capi-media-webrtc.spec +++ b/packaging/capi-media-webrtc.spec @@ -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 diff --git a/test/webrtc_test.c b/test/webrtc_test.c index fb138960..b76f1c51 100644 --- a/test/webrtc_test.c +++ b/test/webrtc_test.c @@ -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)