Fix the bug about invalid event fd 83/287483/1 accepted/tizen/unified/20230131.162137 accepted/tizen/unified/20230201.031125 accepted/tizen/unified/20230201.083523
authorSeonah Moon <seonah1.moon@samsung.com>
Mon, 30 Jan 2023 13:43:55 +0000 (22:43 +0900)
committerSeonah Moon <seonah1.moon@samsung.com>
Mon, 30 Jan 2023 13:44:01 +0000 (22:44 +0900)
Change-Id: I42b29d55932d59fd875bb4ec3770ed9ebc931308

packaging/capi-network-vine.spec
src/vine-event-loop-epoll.cpp

index 11aaee7..78f1b6b 100755 (executable)
@@ -3,7 +3,7 @@
 %bcond_without use_glib_event_loop
 Name:    capi-network-vine
 Summary: An service discovery framework
-Version: 1.3.0
+Version: 1.3.1
 Release: 0
 Group:   Network & Connectivity/API
 License: Apache-2.0
index 5ab153d..9170517 100755 (executable)
@@ -81,13 +81,17 @@ static void *__vine_event_loop_epoll_run(void *arg)
                }
 
                for (int i = 0; i < n; ++i) {
-                       if (_find_io_event_handler(events[i].data.fd) == NULL) {
-                               VINE_LOGI("Removed fd[%d]", events[i].data.fd);
+                       vine_epoll_io_event_handler *h = (vine_epoll_io_event_handler *)events[i].data.ptr;
+
+                       if (!h)
+                               continue;
+
+                       if (_find_io_event_handler(h->fd) == NULL) {
+                               VINE_LOGI("Removed fd[%d]", h->fd);
                                continue;
                        }
 
-                       vine_epoll_io_event_handler *h = (vine_epoll_io_event_handler *)events[i].data.ptr;
-                       if (h && h->fd > 0 && h->handler)
+                       if (h->handler)
                                h->handler(h->fd, events[i].events, h->user_data);
                }
        } while (!__cleanup);