File: 0003-Fix-64-bit-compatibility-memory-allocation-bug.patch

package info (click to toggle)
xdelta 1.1.3-10.8
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,564 kB
  • sloc: ansic: 10,499; sh: 7,542; lisp: 1,525; makefile: 70
file content (25 lines) | stat: -rw-r--r-- 933 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
From: Ludek Smid <lsmid@redhat.com>
Date: Mon, 2 Oct 2006 15:11:36 +0200
Subject: Fix 64-bit compatibility memory allocation bug

Fix memory allocation bug that prevented to apply patches created on x86
platform to be applied on x86_64 platform. For some reason, amount of
memory to allocate is specified in the delta file, but on 64bit platforms,
you need more space for pointers.
---
 libedsio/fh.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/libedsio/fh.c b/libedsio/fh.c
index 9135f8b..7f2f8ba 100644
--- a/libedsio/fh.c
+++ b/libedsio/fh.c
@@ -92,6 +92,8 @@ handle_source_type (SerialSource* source, gboolean set_allocation)
     {
       if (! ssource->fh->table->table_handle_getui (ssource->fh, &source->alloc_total))
 	return ST_Error;
+      /* There are 12 pointers in all required structures. So 64 bit arch needs 48 more bytes. */
+      source->alloc_total += (sizeof(void *) - 4) * 12;
     }
 
   return x;