From: Sangchul Lee Date: Tue, 26 Apr 2022 08:02:47 +0000 (+0900) Subject: webrtc_test: Check return value of g_io_channel_read_chars() X-Git-Tag: submit/tizen/20220426.090157^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F26%2F274326%2F1;p=platform%2Fcore%2Fapi%2Fwebrtc.git webrtc_test: Check return value of g_io_channel_read_chars() [Version] 0.3.96 [Issue Type] Coverity defects Change-Id: I0320f4b95c94da0dec4ef2f447c90d6b561aa6c1 Signed-off-by: Sangchul Lee --- diff --git a/packaging/capi-media-webrtc.spec b/packaging/capi-media-webrtc.spec index 529f3714..2e6ac64c 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.95 +Version: 0.3.96 Release: 0 Group: Multimedia/API License: Apache-2.0 diff --git a/test/webrtc_test.c b/test/webrtc_test.c index 3925df83..04657a24 100644 --- a/test/webrtc_test.c +++ b/test/webrtc_test.c @@ -5600,11 +5600,16 @@ static void interpret(char *cmd) static gboolean input_watch_cb(GIOChannel *channel, GIOCondition condition, gpointer data) { + GIOStatus status; gchar buf[MAX_STRING_LEN]; gsize read; - GError *error = NULL; - g_io_channel_read_chars(channel, buf, MAX_STRING_LEN, &read, &error); + status = g_io_channel_read_chars(channel, buf, sizeof(buf), &read, NULL); + if (status != G_IO_STATUS_NORMAL) { + g_printerr("failed to g_io_channel_read_chars(), status[%d]", status); + return TRUE; + } + buf[read] = '\0'; g_strstrip(buf); interpret(buf);