summaryrefslogtreecommitdiff
path: root/src/lib/ecore_con
diff options
context:
space:
mode:
authorBryce Harrington <bryce@osg.samsung.com>2017-04-12 14:38:56 -0700
committerCedric BAIL <cedric@osg.samsung.com>2017-04-12 14:39:08 -0700
commit6ea18851ba9f345f3fc49a7c154048f2832cdfe9 (patch)
tree6479ebe93bd995d4cf77ce62f6b0b2a2dc43c505 /src/lib/ecore_con
parentbb1a8779dbff0aa059f482c89104ff4f07556508 (diff)
ecore_con: send server_upgrade event *after* clearing pending saves
Summary: The _ecore_con_post_event_server_upgrade() call adds an event to free the server_upgrade object, svr, via _ecore_con_server_free(svr) so we should assume srv is freed after it returns. Thus, perform the pending_slice processing prior to calling it. Otherwise it triggers an illegal access (USE_AFTER_FREE) error in Coverity. @fix CID1373485 Reviewers: barbieri Reviewed By: barbieri Subscribers: cedric, jpeg Differential Revision: https://phab.enlightenment.org/D4785 Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
Diffstat (limited to 'src/lib/ecore_con')
-rw-r--r--src/lib/ecore_con/ecore_con_legacy.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/lib/ecore_con/ecore_con_legacy.c b/src/lib/ecore_con/ecore_con_legacy.c
index fd64aabf3c..35cdef87cd 100644
--- a/src/lib/ecore_con/ecore_con_legacy.c
+++ b/src/lib/ecore_con/ecore_con_legacy.c
@@ -1347,7 +1347,6 @@ _ecore_con_server_dialer_connected(void *data, const Efl_Event *event EINA_UNUSE
1347 { 1347 {
1348 svr->ssl.upgrading = EINA_FALSE; 1348 svr->ssl.upgrading = EINA_FALSE;
1349 INF("svr=%p upgraded to SSL at %s (%s)", svr, efl_net_dialer_address_dial_get(svr->dialer), efl_net_socket_address_remote_get(svr->dialer)); 1349 INF("svr=%p upgraded to SSL at %s (%s)", svr, efl_net_dialer_address_dial_get(svr->dialer), efl_net_socket_address_remote_get(svr->dialer));
1350 _ecore_con_post_event_server_upgrade(svr);
1351 if (svr->ssl.pending_send) 1350 if (svr->ssl.pending_send)
1352 { 1351 {
1353 Eina_Slice slice = eina_binbuf_slice_get(svr->ssl.pending_send); 1352 Eina_Slice slice = eina_binbuf_slice_get(svr->ssl.pending_send);
@@ -1355,6 +1354,7 @@ _ecore_con_server_dialer_connected(void *data, const Efl_Event *event EINA_UNUSE
1355 eina_binbuf_free(svr->ssl.pending_send); 1354 eina_binbuf_free(svr->ssl.pending_send);
1356 svr->ssl.pending_send = NULL; 1355 svr->ssl.pending_send = NULL;
1357 } 1356 }
1357 _ecore_con_post_event_server_upgrade(svr);
1358 return; 1358 return;
1359 } 1359 }
1360 1360