From: Zou Nan hai Date: Tue, 7 Feb 2006 03:25:55 +0000 (+0800) Subject: [IA64] Fix a possible buffer overflow in efi.c X-Git-Tag: v2.6.16-rc3~51^2~3 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ecdd5dabd33d67066d476467e447cdcadab90550;p=linux-2.6 [IA64] Fix a possible buffer overflow in efi.c Make sure to save space for the trailing '\0'. Signed-off-by: Zou Nan hai Signed-off-by: Tony Luck --- diff --git a/arch/ia64/kernel/efi.c b/arch/ia64/kernel/efi.c index c485a3b32b..d51c2f2148 100644 --- a/arch/ia64/kernel/efi.c +++ b/arch/ia64/kernel/efi.c @@ -458,7 +458,7 @@ efi_init (void) /* Show what we know for posterity */ c16 = __va(efi.systab->fw_vendor); if (c16) { - for (i = 0;i < (int) sizeof(vendor) && *c16; ++i) + for (i = 0;i < (int) sizeof(vendor) - 1 && *c16; ++i) vendor[i] = *c16++; vendor[i] = '\0'; }