shm: Make sure the zero-sized array is always last in the struct
authorOlivier Crête <olivier.crete@collabora.com>
Thu, 28 Mar 2013 18:36:16 +0000 (14:36 -0400)
committerOlivier Crête <olivier.crete@collabora.com>
Thu, 28 Mar 2013 18:38:40 +0000 (14:38 -0400)
https://bugzilla.gnome.org/show_bug.cgi?id=696681

sys/shm/shmpipe.c

index 4da027b721385e898ebf599e626df0270398e8ae..6376611c72e37dca548206c65ea1b03695604f7a 100644 (file)
@@ -115,10 +115,11 @@ struct _ShmBuffer
 
   ShmBuffer *next;
 
+  uint64_t tag;
+
   int num_clients;
+  /* This must ALWAYS stay last in the struct */
   int clients[0];
-
-  uint64_t tag;
 };