[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#636920: Patch (libxi6: Many programs crash with SIGBUS on startup)



This patch fixes the bus error by making sure the class structs in
copy_classes are 8-byte aligned.

Index: libxi-1.4.3/src/XExtInt.c
===================================================================
--- libxi-1.4.3.orig/src/XExtInt.c	2011-08-07 02:46:36.164701285 +0200
+++ libxi-1.4.3/src/XExtInt.c	2011-08-07 02:37:50.808340152 +0200
@@ -1435,7 +1435,7 @@
                 break;
         }
 
-        len += l;
+        len = ((len + 7) & -8) + l;
         ptr_wire += any_wire->length * 4;
     }
 
@@ -1467,6 +1467,7 @@
 
     for (i = 0; i < nclasses; i++)
     {
+        ptr_lib = (void*)(((size_t)ptr_lib + 7) & -8);
         any_lib = (XIAnyClassInfo*)ptr_lib;
         any_wire = (xXIAnyInfo*)ptr_wire;
 

Attachment: signature.asc
Description: This is a digitally signed message part


Reply to: