xen/xen-3.1.0-gcc4.patch

21 lines
765 B
Diff
Raw Permalink Normal View History

diff -Nru xen-3.1.0-src.orig/tools/libxc/xc_core.c xen-3.1.0-src/tools/libxc/xc_core.c
--- xen-3.1.0-src.orig/tools/libxc/xc_core.c 2007-05-18 16:45:21.000000000 +0200
+++ xen-3.1.0-src/tools/libxc/xc_core.c 2007-06-22 18:47:13.000000000 +0200
@@ -192,12 +192,14 @@
if ( sheaders->num == sheaders->num_max )
{
Elf64_Shdr *shdrs;
- if ( sheaders->num_max + SHDR_INC < sheaders->num_max )
+
+ sheaders->num_max += SHDR_INC;
+ if ( sheaders->num_max < SHDR_INC )
{
errno = E2BIG;
return NULL;
}
- sheaders->num_max += SHDR_INC;
+
shdrs = realloc(sheaders->shdrs,
sizeof(sheaders->shdrs[0]) * sheaders->num_max);
if ( shdrs == NULL )