diff --git a/ChangeLog b/ChangeLog index 7d4ca0ad4..5119013f0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-04-14 Bean + + * util/grub-pe2elf.c (write_symbol_table): Terminate short name symbol + properly with null character. + 2009-04-14 Felix Zielcke * configure: Remove. diff --git a/util/grub-pe2elf.c b/util/grub-pe2elf.c index d703d33c3..ddcebc110 100644 --- a/util/grub-pe2elf.c +++ b/util/grub-pe2elf.c @@ -344,10 +344,17 @@ write_symbol_table (FILE* fp, char *image, } else { + char short_name[9]; char *name; - name = ((pe_symtab->long_name[0]) ? pe_symtab->short_name : - pe_strtab + pe_symtab->long_name[1]); + if (pe_symtab->long_name[0]) + { + strncpy (short_name, pe_symtab->short_name, 8); + short_name[8] = 0; + name = short_name; + } + else + name = pe_strtab + pe_symtab->long_name[1]; if ((strcmp (name, "_grub_mod_init")) && (strcmp (name, "_grub_mod_fini")) &&