Commit Graph

7 Commits

Author SHA1 Message Date
Lubomir Rintel 1ecc8af5ce nvramcui: don't init curses too early
Init curses as late as possible and tear them down early. There are possible
error outs after that and they don't look nice with curses initialized.

Change-Id: I9128ae8eee25940716b8d223cc7ec6c0abb6838e
Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
Reviewed-on: http://review.coreboot.org/8528
Tested-by: build bot (Jenkins)
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2015-02-25 21:06:22 +01:00
Lubomir Rintel 18860d7a4f nvramcui: fix a buffer overflow
Missing parentheses around addition.

==22611== Invalid write of size 8
==22611==    at 0x401B26: main (nvramcui.c:146)
==22611==  Address 0x5a67c40 is 32 bytes inside a block of size 33 alloc'd
==22611==    at 0x4C2BC0F: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==22611==    by 0x401AA9: main (nvramcui.c:137)

Change-Id: I9fd6a619dd03ebaaa066bca8fa5838e76374c984
Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
Reviewed-on: http://review.coreboot.org/8527
Tested-by: build bot (Jenkins)
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2015-02-25 21:06:19 +01:00
Lubomir Rintel 68009e98ab nvramcui: don't wait for the first key update to render the form
Flush out the initial screen window and render the form before the first
keypress. It looks overly weird otherwise and is very likely unintended.

Change-Id: I8700e36e608f2ba115359070f75b7dc9f230291e
Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
Reviewed-on: http://review.coreboot.org/8526
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2015-02-25 21:06:15 +01:00
Lubomir Rintel e5853d5235 nvramcui: drop unused variable
nvramcui.c: In function ‘main’:
nvramcui.c:68:8: warning: unused variable ‘cur’ [-Wunused-variable]
  ITEM *cur;
        ^

Change-Id: I5c692fc2e6da460cd7c6f7978378c92587d829d2
Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
Reviewed-on: http://review.coreboot.org/8525
Tested-by: build bot (Jenkins)
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2015-02-25 14:09:40 +01:00
Vladimir Serbinenko c9babb278f nvramcui: Trim values when setting.
Values get space-padded by curses and then enum search fails to match them.
Rtrim to compensate for curses.

Change-Id: Iecf095f21cfade9425eaa039b67625615eb80481
Signed-off-by: Vladimir Serbinenko <phcoder@gmail.com>
Reviewed-on: http://review.coreboot.org/4692
Reviewed-by: Nico Huber <nico.h@gmx.de>
Tested-by: build bot (Jenkins)
2014-01-19 15:09:29 +01:00
Paul Menzel a46a712610 GPLv2 notice: Unify all files to just use one space in »MA 02110-1301«
In the file `COPYING` in the coreboot repository and upstream [1]
just one space is used.

The following command was used to convert all files.

    $ git grep -l 'MA  02' | xargs sed -i 's/MA  02/MA 02/'

[1] http://www.gnu.org/licenses/gpl-2.0.txt

Change-Id: Ic956dab2820a9e2ccb7841cab66966ba168f305f
Signed-off-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-on: http://review.coreboot.org/2490
Tested-by: build bot (Jenkins)
Reviewed-by: Anton Kochkov <anton.kochkov@gmail.com>
2013-03-01 10:16:08 +01:00
Patrick Georgi 4b62ebe961 Add nvramcui
nvramcui is a small libpayload based utility that provides
an interactive CMOS editor for pre-boot environments.

Change-Id: I514b8a7682f89d242d1b31b6907cc6bff34da4bf
Signed-off-by: Patrick Georgi <patrick.georgi@secunet.com>
Reviewed-on: http://review.coreboot.org/1871
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2012-11-19 19:10:24 +01:00