diff options
author | Darren Jenkins <darrenrjenkins@gmail.com> | 2006-03-26 04:37:34 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-03-26 11:56:57 -0500 |
commit | d6d21dfdd305bf94300df13ff472141d3411ea17 (patch) | |
tree | 68468809491f981931db2d2bce4036d151289009 /arch | |
parent | 3ac8bf077d0f13b9c3131dd61f9f76c78c322858 (diff) |
[PATCH] fix array overrun in efi.c
Coverity found an over-run @ line 364 of efi.c
This is due to the loop checking the size correctly, then adding a '\0'
after possibly hitting the end of the array.
Ensure the loop exits with one space left in the array.
Signed-off-by: Darren Jenkins <darrenrjenkins@gmail.com>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/i386/kernel/efi.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/i386/kernel/efi.c b/arch/i386/kernel/efi.c index c224c2aebbab..9202b67c4b2e 100644 --- a/arch/i386/kernel/efi.c +++ b/arch/i386/kernel/efi.c | |||
@@ -361,7 +361,7 @@ void __init efi_init(void) | |||
361 | */ | 361 | */ |
362 | c16 = (efi_char16_t *) boot_ioremap(efi.systab->fw_vendor, 2); | 362 | c16 = (efi_char16_t *) boot_ioremap(efi.systab->fw_vendor, 2); |
363 | if (c16) { | 363 | if (c16) { |
364 | for (i = 0; i < sizeof(vendor) && *c16; ++i) | 364 | for (i = 0; i < (sizeof(vendor) - 1) && *c16; ++i) |
365 | vendor[i] = *c16++; | 365 | vendor[i] = *c16++; |
366 | vendor[i] = '\0'; | 366 | vendor[i] = '\0'; |
367 | } else | 367 | } else |