[patch 02/11] terminal: Do not call toupper with potentially out-of-range values.

Kalle Olavi Niemitalo <[email protected]>
Newsgroups gmane.comp.web.links
Message-ID <[email protected]>
_______________________________________________
elinks-dev mailing list
[email protected]
http://linuxfromscratch.org/mailman/listinfo/elinks-dev
02 (text/x-patch, 1.1 KB)
terminal: Do not call toupper with potentially out-of-range values.

For instance, if Ctrl-F1 were pressed and src/terminal/kbd.c supported it,
then toupper(KBD_F1) would be called, resulting in undefined behaviour.
src/terminal/kbd.c does not support such combinations yet, but it is
safest to fix the bug already.

---
commit 129c5bb4dcafbfcf62d75c3e02db45699fb56536
tree eff984b17a0b9497ecafe88e5134db0f029fc2b9
parent ec5615acd7252563fc4745f14a7afbba049227fa
author Kalle Olavi Niemitalo <[email protected]> Sat, 05 Aug 2006 13:30:00 +0300
committer Kalle Olavi Niemitalo <[email protected]> Sat, 05 Aug 2006 19:51:30 +0300

 src/terminal/event.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/terminal/event.c b/src/terminal/event.c
index 71f3950..2032e0e 100644
--- a/src/terminal/event.c
+++ b/src/terminal/event.c
@@ -256,7 +256,7 @@ #endif
 
 		reset_timer();
 
-		if (check_kbd_modifier(ev, KBD_MOD_CTRL) && toupper(key) == 'L') {
+		if (check_kbd_modifier(ev, KBD_MOD_CTRL) && (key == 'l' || key == 'L')) {
 			redraw_terminal_cls(term);
 			break;
signature.asc (application/pgp-signature, 188 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (GNU/Linux)

iD8DBQFE1N7BHm9IGt60eMgRAh+XAKDjeNC03oTlu0DLhSeyBKtXJAIDNACgkZZJ
auuaITWK2zbW7YOOO91t78g=
=r1Zh
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.