Fix the bug about invalid event fd 85/287485/1 accepted/tizen_7.0_unified accepted/tizen/7.0/unified/20230131.073558
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 14:00:27 +0000 (23:00 +0900)
Change-Id: Ib2304c66e9db0fa0557b1dfed375409622880691

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

index 6f7a6f3126b82c06556053bfb63e9946c8128710..9f939da25a8665aec94d54a3ffd94688bf3fb25f 100755 (executable)
@@ -3,7 +3,7 @@
 %bcond_without use_glib_event_loop
 Name:    capi-network-vine
 Summary: An service discovery framework
-Version: 1.2.10
+Version: 1.2.11
 Release: 0
 Group:   Network & Connectivity/API
 License: Apache-2.0
index 5ab153db2f8f55f16a7c0629d9971741a2365922..91705175ed8343e88221ee7c4816c9fd26b3033e 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);