X-Git-Url: https://git.distorted.org.uk/~mdw/sgt/putty/blobdiff_plain/e14a5a135317d979212d24a94edebfd2109dd182..ab21de779596591471529758bbf6d54b3176ea29:/terminal.c diff --git a/terminal.c b/terminal.c index ccbe4449..856d5b19 100644 --- a/terminal.c +++ b/terminal.c @@ -676,7 +676,7 @@ void term_out(void) { ldisc->send ("PuTTY", 5); break; case '\007': - beep(); + if(cfg.beep) beep(); disptop = scrtop; break; case '\b': @@ -1209,7 +1209,11 @@ void term_out(void) { */ compatibility(VT340TEXT); if (esc_nargs<=1 && (esc_args[0]<1 || esc_args[0]>=24)) { - request_resize (cols, def(esc_args[0], 24), 0); + unsigned int newrows = def(esc_args[0], 24); + /* Hack: prevent big-resize DoS attack. */ + if (newrows > max(512, cfg.height)) + newrows = max(512, cfg.height); + request_resize (cols, newrows, 0); deselect(); } break; @@ -1221,7 +1225,11 @@ void term_out(void) { */ compatibility(VT420); if (esc_nargs==1 && esc_args[0]>=24) { - request_resize (cols, def(esc_args[0], cfg.height), 0); + unsigned int newrows = def(esc_args[0], cfg.height); + /* Hack: prevent big-resize DoS attack. */ + if (newrows > max(512, cfg.height)) + newrows = max(512, cfg.height); + request_resize (cols, newrows, 0); deselect(); } break; @@ -1232,7 +1240,11 @@ void term_out(void) { */ compatibility(VT340TEXT); if (esc_nargs<=1) { - request_resize (cols, def(esc_args[0], cfg.width), 0); + unsigned int newcols = def(esc_args[0], cfg.width); + /* Hack: prevent big-resize DoS attack. */ + if (newcols > max(512, cfg.width)) + newcols = max(512, cfg.width); + request_resize (newcols, rows, 0); deselect(); } break; @@ -1535,8 +1547,10 @@ static void do_paint (Context ctx, int may_optimise){ if (cursor_on) { if (has_focus) { - if (blinker) cursor = ATTR_ACTCURS; - else cursor = 0; + if (blinker || !cfg.blink_cur) + cursor = ATTR_ACTCURS; + else + cursor = 0; } else cursor = ATTR_PASCURS;