mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-03-21 14:18:38 -05: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:
parent
916cd3f0cd
commit
1f3901a3a2
@ -1223,6 +1223,7 @@ gint key_event(GtkWidget *widget, GdkEventKey *event, gpointer data)
|
|||||||
void input_method_commit_event(GtkIMContext *imc, gchar *str, gpointer data)
|
void input_method_commit_event(GtkIMContext *imc, gchar *str, gpointer data)
|
||||||
{
|
{
|
||||||
struct gui_data *inst = (struct gui_data *)data;
|
struct gui_data *inst = (struct gui_data *)data;
|
||||||
|
if (inst->ldisc)
|
||||||
lpage_send(inst->ldisc, CS_UTF8, str, strlen(str), 1);
|
lpage_send(inst->ldisc, CS_UTF8, str, strlen(str), 1);
|
||||||
show_mouseptr(inst, 0);
|
show_mouseptr(inst, 0);
|
||||||
term_seen_key_event(inst->term);
|
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
|
* Flush the line discipline's edit buffer in the case
|
||||||
* where local editing has just been disabled.
|
* where local editing has just been disabled.
|
||||||
*/
|
*/
|
||||||
|
if (inst->ldisc) {
|
||||||
ldisc_configure(inst->ldisc, inst->conf);
|
ldisc_configure(inst->ldisc, inst->conf);
|
||||||
if (inst->ldisc)
|
|
||||||
ldisc_send(inst->ldisc, NULL, 0, 0);
|
ldisc_send(inst->ldisc, NULL, 0, 0);
|
||||||
|
}
|
||||||
/* Pass new config data to the terminal */
|
/* Pass new config data to the terminal */
|
||||||
term_reconfig(inst->term, inst->conf);
|
term_reconfig(inst->term, inst->conf);
|
||||||
/* Pass new config data to the back end */
|
/* Pass new config data to the back end */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user