[gamin] [patch] gamin bus error on sparc



Hi

  In gam_connection.c gam_connection_data shifts the GAMPacketPtr over the
  request buffer. This can cause the req pointer to be unaligned.

  Although that works fine on x86 and some other archs, on a sparc it causes
  a bus error when accessing it's len field.

  Patch with a fix attached.

  Sjoerd
-- 
When you die, you lose a very important part of your life.
		-- Brooke Shields
Index: gam_connection.c
===================================================================
RCS file: /cvs/gnome/gamin/server/gam_connection.c,v
retrieving revision 1.25
diff -u -r1.25 gam_connection.c
--- gam_connection.c	5 Aug 2005 19:07:16 -0000	1.25
+++ gam_connection.c	26 Aug 2005 17:39:28 -0000
@@ -493,11 +493,8 @@
         if (conn->request_len == 0)
             break;
 
-	req = (void *) req + req->len;
+        memmove(&conn->request, (void *)req + req->len, conn->request_len);
     }
-
-    if (conn->request_len > 0 && req != &conn->request)
-	memmove(&conn->request, req, conn->request_len);
 
     return (0);
 }


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