simon-git: putty (master): Simon Tatham

Commits to Tartarus hosted VCS tartarus-commits at lists.tartarus.org
Fri May 18 14:38:47 BST 2018


TL;DR:
  a51dbf3 terminal.c: factor out the graphic-character display.
  2b5b843 Support the REP escape sequence (CSI Pn b).

Repository:     https://git.tartarus.org/simon/putty.git
On the web:     https://git.tartarus.org/?p=simon/putty.git
Branch updated: master
Committer:      Simon Tatham <anakin at pobox.com>
Date:           2018-05-18 14:38:47

commit a51dbf3f08bbb7980ff31d498c15915bb46eaee7
web diff https://git.tartarus.org/?p=simon/putty.git;a=commitdiff;h=a51dbf3f08bbb7980ff31d498c15915bb46eaee7;hp=6893f00e42619311e5f12faf4eb12b35b271c2f2
Author: Simon Tatham <anakin at pobox.com>
Date:   Fri May 18 14:16:11 2018 +0100

    terminal.c: factor out the graphic-character display.
    
    I'm about to want to implement an escape sequence that causes a
    graphic character to be printed, which means I'll need the code that
    does so to be in a separate routine that I can call easily, instead of
    buried a few loops deep in the middle of the main state machine.

 terminal.c | 280 ++++++++++++++++++++++++++++++-------------------------------
 1 file changed, 138 insertions(+), 142 deletions(-)

commit 2b5b843849b2d491cac563f81fbb41d2fa17dde3
web diff https://git.tartarus.org/?p=simon/putty.git;a=commitdiff;h=2b5b843849b2d491cac563f81fbb41d2fa17dde3;hp=a51dbf3f08bbb7980ff31d498c15915bb46eaee7
Author: Simon Tatham <anakin at pobox.com>
Date:   Fri May 18 14:17:06 2018 +0100

    Support the REP escape sequence (CSI Pn b).
    
    This causes the previous graphic character to be displayed another Pn
    times (defaulting to 1, as usual). I just found out about it because
    Ubuntu 18.04's ncurses expects it to be honoured.
    
    According to all-escapes, REP is only supposed to be used when the
    thing immediately preceding it in the terminal data stream _is_ a
    printing character, and if not, then the behaviour is undefined. But
    'undefined' is good enough for me to do the simple thing of just
    remembering the last graphic character no matter whether anything else
    has intervened since then.
    
    To avoid DoS attacks using this escape sequence with a really huge Pn,
    I clamp the value at the total size of the screen. There might be ways
    to do that with more finesse (e.g. reduce it mod the width so that the
    screen ends up looking the way it should even for huge parameters, or
    reduce it even further if we notice the terminal isn't in wrapping
    modes), but this will do for now.

 terminal.c | 10 ++++++++++
 terminal.h |  2 ++
 2 files changed, 12 insertions(+)



More information about the tartarus-commits mailing list