mirror of
https://github.com/ZoiteChat/zoitechat.git
synced 2026-06-09 08:20:18 +00:00
Fix detached tab reattach UAF crash path
This commit is contained in:
@@ -2705,7 +2705,6 @@ mg_changui_destroy (session *sess)
|
|||||||
/* it fixes: Gdk-CRITICAL **: gdk_colormap_get_screen: */
|
/* it fixes: Gdk-CRITICAL **: gdk_colormap_get_screen: */
|
||||||
/* assertion `GDK_IS_COLORMAP (cmap)' failed */
|
/* assertion `GDK_IS_COLORMAP (cmap)' failed */
|
||||||
ret = sess->gui->window;
|
ret = sess->gui->window;
|
||||||
g_free (sess->gui);
|
|
||||||
sess->gui = NULL;
|
sess->gui = NULL;
|
||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
@@ -2727,13 +2726,17 @@ mg_link_irctab (session *sess, int focus)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
session_gui *old_gui;
|
||||||
|
|
||||||
mg_unpopulate (sess);
|
mg_unpopulate (sess);
|
||||||
|
old_gui = sess->gui;
|
||||||
win = mg_changui_destroy (sess);
|
win = mg_changui_destroy (sess);
|
||||||
mg_changui_new (sess, sess->res, 1, focus);
|
mg_changui_new (sess, sess->res, 1, focus);
|
||||||
/* the buffer is now attached to a different widget */
|
/* the buffer is now attached to a different widget */
|
||||||
((xtext_buffer *)sess->res->buffer)->xtext = (GtkXText *)sess->gui->xtext;
|
((xtext_buffer *)sess->res->buffer)->xtext = (GtkXText *)sess->gui->xtext;
|
||||||
if (win)
|
if (win)
|
||||||
gtk_widget_destroy (win);
|
gtk_widget_destroy (win);
|
||||||
|
g_free (old_gui);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|||||||
Reference in New Issue
Block a user