[2111] 2009-04-14 Bean <[email protected]>

Bean <[email protected]>
Newsgroups gmane.comp.boot-loaders.grub.cvs
Message-ID <[email protected]>
Revision: 2111
          http://svn.sv.gnu.org/viewvc/?view=rev&root=grub&revision=2111
Author:   bean
Date:     2009-04-14 16:56:35 +0000 (Tue, 14 Apr 2009)
Log Message:
-----------
2009-04-14  Bean  <[email protected]>

	* util/grub-pe2elf.c (write_symbol_table): Terminate short name symbol
	properly with null character.

Modified Paths:
--------------
    trunk/grub2/ChangeLog
    trunk/grub2/util/grub-pe2elf.c

Modified: trunk/grub2/ChangeLog
===================================================================
--- trunk/grub2/ChangeLog	2009-04-14 16:17:10 UTC (rev 2110)
+++ trunk/grub2/ChangeLog	2009-04-14 16:56:35 UTC (rev 2111)
@@ -1,3 +1,8 @@
+2009-04-14  Bean  <[email protected]>
+
+	* util/grub-pe2elf.c (write_symbol_table): Terminate short name symbol
+	properly with null character.
+
 2009-04-14  Felix Zielcke  <[email protected]>
 
 	* configure: Remove.

Modified: trunk/grub2/util/grub-pe2elf.c
===================================================================
--- trunk/grub2/util/grub-pe2elf.c	2009-04-14 16:17:10 UTC (rev 2110)
+++ trunk/grub2/util/grub-pe2elf.c	2009-04-14 16:56:35 UTC (rev 2111)
@@ -344,10 +344,17 @@
         }
       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")) &&
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.