webrtc_test: Check return value of g_io_channel_read_chars() 29/274629/1
authorSangchul Lee <sc11.lee@samsung.com>
Tue, 26 Apr 2022 08:02:47 +0000 (17:02 +0900)
committerSangchul Lee <sc11.lee@samsung.com>
Wed, 4 May 2022 03:33:25 +0000 (12:33 +0900)
[Version] 0.2.166
[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 ef0a312015a87d870325de1e97860a3e789af9ac..7289268b91b684ce21d0041667da95544f73b667 100644 (file)
@@ -1,6 +1,6 @@
 Name:       capi-media-webrtc
 Summary:    A WebRTC library in Tizen Native API
-Version:    0.2.165
+Version:    0.2.166
 Release:    0
 Group:      Multimedia/API
 License:    Apache-2.0
index 25e718d5c500904f327dc93afe274d21f677ca51..95239deacd72b0195f872d8e45033440bc9a4170 100644 (file)
@@ -4884,11 +4884,16 @@ static void interpret(char *cmd)
 
 gboolean input(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);