diff options
author | Erwan Velu <erwan.velu@free.fr> | 2009-12-02 22:31:18 +0100 |
---|---|---|
committer | Erwan Velu <erwan.velu@free.fr> | 2009-12-04 16:26:27 +0100 |
commit | 9918c3cb0b0302518374bddb4e40a501b72a6720 (patch) | |
tree | f56bfafcf1578d4b85e05cd3794b28e7a6f5d011 | |
parent | 72ac272320910ad39028dd84ad8e48e885eed9d2 (diff) | |
download | syslinux-9918c3cb0b0302518374bddb4e40a501b72a6720.tar.gz |
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.c | 9 |
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; |