WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] [xen-unstable] [XEN] Avoid void* arithmetic in elfnote c

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] [XEN] Avoid void* arithmetic in elfnote code.
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Fri, 19 Jan 2007 10:45:14 -0800
Delivery-date: Fri, 19 Jan 2007 10:45:42 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User kfraser@xxxxxxxxxxxxxxxxxxxxx
# Date 1169218982 0
# Node ID 1e5ad8ccb286300643fb7e8d59a8bd01b7ccdc81
# Parent  1a45828882e9b49e4c5927541ea336ecd24c041b
[XEN] Avoid void* arithmetic in elfnote code.
From: Christoph Egger <Christoph.Egger@xxxxxxx>
Signed-off-by: Keir Fraser <keir@xxxxxxxxxxxxx>
---
 xen/common/elf.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff -r 1a45828882e9 -r 1e5ad8ccb286 xen/common/elf.c
--- a/xen/common/elf.c  Fri Jan 19 14:41:17 2007 +0000
+++ b/xen/common/elf.c  Fri Jan 19 15:03:02 2007 +0000
@@ -102,7 +102,7 @@ static unsigned long long xen_guest_nume
 /*
  * Interface to the Xen ELF notes.
  */
-#define ELFNOTE_NAME(_n_)   ((const void*)(_n_) + sizeof(*(_n_)))
+#define ELFNOTE_NAME(_n_)   ((const char*)(_n_) + sizeof(*(_n_)))
 #define ELFNOTE_DESC(_n_)   (ELFNOTE_NAME(_n_) + (((_n_)->namesz+3)&~3))
 #define ELFNOTE_NEXT(_n_)   (ELFNOTE_DESC(_n_) + (((_n_)->descsz+3)&~3))
 
@@ -115,7 +115,7 @@ static int is_xen_elfnote_section(const 
 
     for ( note = (const Elf_Note *)(image + shdr->sh_offset);
           note < (const Elf_Note *)(image + shdr->sh_offset + shdr->sh_size);
-          note = ELFNOTE_NEXT(note) )
+          note = (const Elf_Note *)ELFNOTE_NEXT(note) )
     {
         if ( !strncmp(ELFNOTE_NAME(note), "Xen", 4) )
             return 1;
@@ -134,7 +134,7 @@ static const Elf_Note *xen_elfnote_looku
 
     for ( note = (const Elf_Note *)dsi->__elfnote_section;
           note < (const Elf_Note *)dsi->__elfnote_section_end;
-          note = ELFNOTE_NEXT(note) )
+          note = (const Elf_Note *)ELFNOTE_NEXT(note) )
     {
         if ( strncmp(ELFNOTE_NAME(note), "Xen", 4) )
             continue;
@@ -227,9 +227,9 @@ int parseelfimage(struct domain_setup_in
             image + ehdr->e_shoff + (h*ehdr->e_shentsize));
         if ( !is_xen_elfnote_section(image, shdr) )
             continue;
-        dsi->__elfnote_section = (const void *)image + shdr->sh_offset;
+        dsi->__elfnote_section = (const char *)image + shdr->sh_offset;
         dsi->__elfnote_section_end =
-            (const void *)image + shdr->sh_offset + shdr->sh_size;
+            (const char *)image + shdr->sh_offset + shdr->sh_size;
         break;
     }
 

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] [XEN] Avoid void* arithmetic in elfnote code., Xen patchbot-unstable <=