webrtc_test: Check return value of g_io_channel_read_chars() 26/274326/1 submit/tizen/20220426.090157
authorSangchul Lee <sc11.lee@samsung.com>
Tue, 26 Apr 2022 08:02:47 +0000 (17:02 +0900)
committerSangchul Lee <sc11.lee@samsung.com>
Tue, 26 Apr 2022 08:02:47 +0000 (17:02 +0900)
[Version] 0.3.96
[Issue Type] Coverity defects

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

index 529f3714f83c7763e0eac6cb0675850c640fc08d..2e6ac64c0ba39aef043583c8e65bfc09c229fa74 100644 (file)
@@ -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
index 3925df83543a003be4f29f28dd9fb52183b3786a..04657a24bbdb585e556db27f4a565777de04c245 100644 (file)
@@ -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);