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-devel

[Xen-devel] possible bug on libxc ? on amd64

To: <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] possible bug on libxc ? on amd64
From: "Enrico Maniciati" <enrico.maniciati@xxxxxxxxxxx>
Date: Sat, 1 Dec 2007 16:25:13 +0100
Delivery-date: Sat, 01 Dec 2007 07:26:03 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: Acg0Ll4dJI08UQfZTXaSWK06d7OwKA==

 

In function  :

 

Elf64_Shdr*

xc_core_shdr_get(struct xc_core_section_headers *sheaders) {

    Elf64_Shdr *shdr;

 

    if ( sheaders->num == sheaders->num_max )

    {

        Elf64_Shdr *shdrs;

        if ( sheaders->num_max + SHDR_INC < sheaders->num_max )  <--- in this point

 

 

// I think at this point ,sheaders->num_max + SHDR_INC always is major or equal than sheaders->num_max 

 

// I think : x + y > x     

 

My consideration was only for resolving error compiling because I not have time to learn what libxc are and what I can use function

 

J

 

 

 

       {

            errno = E2BIG;

            return NULL;

        }

 

        sheaders->num_max += SHDR_INC;

        shdrs = realloc(sheaders->shdrs,

                        sizeof(sheaders->shdrs[0]) * sheaders->num_max);

 

 

        if ( shdrs == NULL ) <<-- word wrap ??

            return NULL;

        sheaders->shdrs = shdrs;

 

 

i think this are correct:

 

       if ( shdrs == NULL ) return NULL;

 

        sheaders->shdrs = shdrs;

 

 

or:

 

 

if ( shdrs == NULL ) {return NULL};

        sheaders->shdrs = shdrs;

 

    }

 

    shdr = &sheaders->shdrs[sheaders->num];

    sheaders->num++;

    memset(shdr, 0, sizeof(*shdr));

    return shdr;

}

 

 

Always happy c++

 

Ps.

C++ are always better than other J 

 

----------------------------------------------------------------------------------------------------------------

 

Maniciati Enrico

Consulenza,progettazione,

realizzazione e assistenza

reti e sistemi informatici

 

email: enrico.maniciati@xxxxxxxxxxx

Skype: erikm.project

Msn: enrico.maniciati@xxxxxxxxxx

----------------------------------------------------------------------------------------------------------------


Il presente messaggio di posta elettronica e l’eventuale allegato contengono informazioni di carattere confidenziale rivolte esclusivamente al destinatario sopra indicato. E’ vietato l’uso, la diffusione, distribuzione o riproduzione da parte di ogni altro soggetto. Nel caso aveste ricevuto questo messaggio per errore, siete pregati di segnalarlo immediatamente al mittente e distruggere quanto ricevuto senza farne copia. I dati personali sono trattati da Maniciati Enrico via L.Ariosto,13 30039 Strà (VE) in conformità al DL.vo 196/2003

----------------------------------------------------------------------------------------------------------------

 

 

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
<Prev in Thread] Current Thread [Next in Thread>