aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorErwan Velu <erwan.velu@free.fr>2009-12-02 22:31:18 +0100
committerErwan Velu <erwan.velu@free.fr>2009-12-04 16:26:27 +0100
commit9918c3cb0b0302518374bddb4e40a501b72a6720 (patch)
treef56bfafcf1578d4b85e05cd3794b28e7a6f5d011
parent72ac272320910ad39028dd84ad8e48e885eed9d2 (diff)
downloadsyslinux.git-9918c3cb0b0302518374bddb4e40a501b72a6720.tar.gz
syslinux.git-9918c3cb0b0302518374bddb4e40a501b72a6720.tar.xz
syslinux.git-9918c3cb0b0302518374bddb4e40a501b72a6720.zip
hdt: Fixing memory corruption in kernel>show
Impact: Fixing memory corruption Fixing memory corruption which occurs during kernel>show This patch makes the init cleaner.
-rw-r--r--com32/hdt/hdt-cli-kernel.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/com32/hdt/hdt-cli-kernel.c b/com32/hdt/hdt-cli-kernel.c
index c97c6a79..d4946f30 100644
--- a/com32/hdt/hdt-cli-kernel.c
+++ b/com32/hdt/hdt-cli-kernel.c
@@ -37,14 +37,12 @@
void main_show_kernel(int argc __unused, char **argv __unused,
struct s_hardware *hardware)
{
- char buffer[1024];
+ char buffer[1024] = {0};
struct pci_device *pci_device;
bool found = false;
char kernel_modules[LINUX_KERNEL_MODULE_SIZE *
MAX_KERNEL_MODULES_PER_PCI_DEVICE];
- memset(buffer, 0, sizeof(buffer));
-
detect_pci(hardware);
reset_more_printf();
more_printf("Kernel modules\n");
@@ -97,11 +95,10 @@ static void show_kernel_modules(int argc __unused, char **argv __unused,
MAX_KERNEL_MODULES_PER_PCI_DEVICE];
bool nopciids = false;
bool nomodulespcimap = false;
- char modules[MAX_PCI_CLASSES][256];
- char category_name[MAX_PCI_CLASSES][256];
+ char modules[MAX_PCI_CLASSES][256] = {{0}};
+ char category_name[MAX_PCI_CLASSES][256] = {{0}};
detect_pci(hardware);
- memset(&modules, 0, sizeof(modules));
if (hardware->pci_ids_return_code == -ENOPCIIDS) {
nopciids = true;