Skip to content

Commit

Permalink
[IA64] Fix a possible buffer overflow in efi.c
Browse files Browse the repository at this point in the history
Make sure to save space for the trailing '\0'.

Signed-off-by: Zou Nan hai <nanhai.zou@intel.com>
Signed-off-by: Tony Luck <tony.luck@intel.com>
  • Loading branch information
Zou Nan hai authored and Tony Luck committed Feb 7, 2006
1 parent d43da75 commit ecdd5da
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion arch/ia64/kernel/efi.c
Original file line number Diff line number Diff line change
Expand Up @@ -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';
}
Expand Down

0 comments on commit ecdd5da

Please sign in to comment.