aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEli Zaretskii2016-12-15 18:18:59 +0200
committerEli Zaretskii2016-12-15 18:18:59 +0200
commit4fbda463dca50f630c31a2602bd34849f4b51e51 (patch)
tree6f0e33fd4c12e1aa26c7ba7eb6e1c464b90c74b5 /src
parent09a66ceb5e906e704be58d5f40c45096307f0b9e (diff)
downloademacs-4fbda463dca50f630c31a2602bd34849f4b51e51.tar.gz
emacs-4fbda463dca50f630c31a2602bd34849f4b51e51.zip
Prevent crashes in xg_select due to concurrency
* src/xgselect.c (xg_select): Don't call Glib functions that use 'context' if we failed to acquire it. This means some other thread owns the context, in which case both using the context and calling block_input/unblock_input will step on that thread's toes and eventually lead to crashes. (Bug#25172)
Diffstat (limited to 'src')
-rw-r--r--src/xgselect.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/xgselect.c b/src/xgselect.c
index 2f23764ae41..a9461a5df5a 100644
--- a/src/xgselect.c
+++ b/src/xgselect.c
@@ -150,7 +150,7 @@ xg_select (int fds_lim, fd_set *rfds, fd_set *wfds, fd_set *efds,
150#else 150#else
151 need_to_dispatch = true; 151 need_to_dispatch = true;
152#endif 152#endif
153 if (need_to_dispatch) 153 if (need_to_dispatch && context_acquired)
154 { 154 {
155 int pselect_errno = errno; 155 int pselect_errno = errno;
156 /* Prevent g_main_dispatch recursion, that would occur without 156 /* Prevent g_main_dispatch recursion, that would occur without