summaryrefslogtreecommitdiffstats
path: root/lib/readkey.c
Commit message (Collapse)AuthorAgeFilesLines
* readkey: fix buffer overflow handling longer escape sequencesAhmad Fatoum2020-09-141-1/+1
| | | | | | | | | | | | My terminal emulator uses "\e[5;5~" (six bytes) to represent a Ctrl+PageUp, this overflows the esc buffer, which is only 5 bytes long as both UBSan and ASAN report. We have a check that should've avoided it, but it has an off-by one, which corrupts memory on sizes >= 4. Fix it. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* treewide: remove references to CREDITSUwe Kleine-König2020-04-271-3/+0
| | | | | | | | The CREDITS file was removed from barebox in 2015 by commit 6570288f2d97 ("Remove the CREDITS file"). Remove references to it from several files. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* readkey: keys are unsigned charMichael Olbrich2017-01-241-2/+2
| | | | | | | Otherwise values > 127 will become negative and are dropped. Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* stdio: rename getc to getcharSascha Hauer2016-04-151-4/+4
| | | | | | | The function we have implemented as getc has the semantics of the standard function getchar, so rename it accorgingly. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* readkey: keys are unsigned charSascha Hauer2014-07-111-1/+1
| | | | | | We have keys with values > 127, so it must be an unsigned char. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* input: Add BB_ prefix to KEY_ definesSascha Hauer2014-02-171-18/+18
| | | | | | | Our KEY_ defines conflict with the standard Linux KEY_ defines, so add a BB_ prefix to them. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Treewide: remove address of the Free Software FoundationSascha Hauer2012-09-171-3/+0
| | | | | | | The FSF address has changed in the past. Instead of updating it each time the address changes, just drop it completely treewide. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* readkey: Use ARRAY_SIZEJan Weitzel2011-11-251-1/+1
| | | | | | | | | | | Update to commit: 6df16cb readkey: force return from while true Use ARRAY_SIZE instead of hardcoded value Signed-off-by: Jan Weitzel <j.weitzel@phytec.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* readkey: force return from while trueJan Weitzel2011-11-221-0/+2
| | | | | | | | | If read_key is feeded by STRG + KEY_LEFT you run into the while(1) loop and corrupt memory through esc array. Force return if index gets too high. Signed-off-by: Jan Weitzel <j.weitzel@phytec.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Remove unnecessary casts in key definesSascha Hauer2009-12-181-1/+1
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* read_key: Use ARRAY_SIZE instead of hardcoded valueSascha Hauer2009-12-181-1/+1
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* export functionsSascha Hauer2007-10-041-1/+1
|
* svn_rev_706Sascha Hauer2007-07-051-0/+23
| | | | add file headers
* svn_rev_643Sascha Hauer2007-07-051-0/+58
structure cleanup