pkgsrc/security/putty/patches/patch-windows_window.c
drochner 9f99c4b9b2 update to 0.63
This fixes a buffer overflow which was patched in pkgsrc (CVE-2013-4852),
two other buffer overflows (CVE-2013-4206, CVE-2013-4207), and
it clears private keys after use now (CVE-2013-4208).
Other than that, there are mostly bug fixes from 0.62 and a few
small features.
2013-08-07 11:06:39 +00:00

27 lines
968 B
C

$NetBSD: patch-windows_window.c,v 1.2 2013/08/07 11:06:39 drochner Exp $
Make the home/end keys work on BSD servers as well as Linux ones
--- windows/window.c.orig 2013-08-04 19:32:10.000000000 +0000
+++ windows/window.c
@@ -4520,9 +4520,17 @@ static int TranslateKey(UINT message, WP
p += sprintf((char *) p, "\x1BO%c", code + 'P' - 11);
return p - output;
}
- if ((code == 1 || code == 4) &&
- conf_get_int(conf, CONF_rxvt_homeend)) {
- p += sprintf((char *) p, code == 1 ? "\x1B[H" : "\x1BOw");
+ /* Home/End */
+ if (code == 1 || code == 4) {
+ /* Send the correct XTerm or rxvt codes for home/end
+ * We used to send ^[1~ and [4~ for Xterm,
+ * but those are Linux console */
+ const char *he;
+ if (conf_get_int(conf, CONF_rxvt_homeend))
+ he = code == 1 ? "\x1B[7~" : "\x1B[8~";
+ else
+ he = code == 1 ? "\x1BOH" : "\x1BOF";
+ p += sprintf((char *) p, he);
return p - output;
}
if (code) {