Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/i386/stand/efiboot efiboot: fix efivar command.
details: https://anonhg.NetBSD.org/src/rev/3314c3604d64
branches: trunk
changeset: 351887:3314c3604d64
user: nonaka <nonaka%NetBSD.org@localhost>
date: Fri Mar 03 09:29:57 2017 +0000
description:
efiboot: fix efivar command.
diffstat:
sys/arch/i386/stand/efiboot/boot.c | 10 +++++++---
1 files changed, 7 insertions(+), 3 deletions(-)
diffs (44 lines):
diff -r 271f8f7f03f6 -r 3314c3604d64 sys/arch/i386/stand/efiboot/boot.c
--- a/sys/arch/i386/stand/efiboot/boot.c Fri Mar 03 07:57:49 2017 +0000
+++ b/sys/arch/i386/stand/efiboot/boot.c Fri Mar 03 09:29:57 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: boot.c,v 1.2 2017/02/03 16:42:26 roy Exp $ */
+/* $NetBSD: boot.c,v 1.3 2017/03/03 09:29:57 nonaka Exp $ */
/*-
* Copyright (c) 2016 Kimihiro Nonaka <nonaka%netbsd.org@localhost>
@@ -557,7 +557,7 @@
L"GUID Variable Name Value\n"
L"=================================== ==================== ========\n";
EFI_STATUS status;
- UINTN sz = 64;
+ UINTN sz = 64, osz;
CHAR16 *name = NULL, *tmp, *val;
EFI_GUID vendor;
UINTN cols, rows, row = 0;
@@ -576,11 +576,12 @@
return;
}
- name[0] = 0;
+ SetMem(name, sz, 0);
vendor = NullGuid;
Print(L"%s", header);
for (;;) {
+ osz = sz;
status = uefi_call_wrapper(RT->GetNextVariableName, 3,
&sz, name, &vendor);
if (EFI_ERROR(status)) {
@@ -598,8 +599,11 @@
(UINT64)sz);
break;
}
+ SetMem(tmp, sz, 0);
+ CopyMem(tmp, name, osz);
FreePool(name);
name = tmp;
+ continue;
}
val = LibGetVariable(name, &vendor);
Home |
Main Index |
Thread Index |
Old Index