1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-01-25 01:02:24 +00:00

Add some missing null checks for inst->ldisc, which were causing

segfaults if a PuTTY or pterm did not close on exit and then you
either typed something via input_method_commit_event or changed the
line editing or echo settings.

[originally from svn r9908]
This commit is contained in:
Simon Tatham 2013-07-11 17:24:20 +00:00
parent 916cd3f0cd
commit 1f3901a3a2

View File

@ -1223,7 +1223,8 @@ gint key_event(GtkWidget *widget, GdkEventKey *event, gpointer data)
void input_method_commit_event(GtkIMContext *imc, gchar *str, gpointer data)
{
struct gui_data *inst = (struct gui_data *)data;
lpage_send(inst->ldisc, CS_UTF8, str, strlen(str), 1);
if (inst->ldisc)
lpage_send(inst->ldisc, CS_UTF8, str, strlen(str), 1);
show_mouseptr(inst, 0);
term_seen_key_event(inst->term);
}
@ -3032,9 +3033,10 @@ void change_settings_menuitem(GtkMenuItem *item, gpointer data)
* Flush the line discipline's edit buffer in the case
* where local editing has just been disabled.
*/
ldisc_configure(inst->ldisc, inst->conf);
if (inst->ldisc)
if (inst->ldisc) {
ldisc_configure(inst->ldisc, inst->conf);
ldisc_send(inst->ldisc, NULL, 0, 0);
}
/* Pass new config data to the terminal */
term_reconfig(inst->term, inst->conf);
/* Pass new config data to the back end */