[compiz] [PATCH] segfault when loading plugins with incompatible ABI

Ioannis Nousias s0238762 at sms.ed.ac.uk
Sun Apr 22 08:18:42 PDT 2007


loading plugins with older ABI caused compiz to crash. Here is a simple 
patch to avoid it. Basically in both cases the counters have some random 
value (large) but the array pointers are NULL, causing the crash.

-Ioannis



diff --git a/src/plugin.c b/src/plugin.c
index 4c7c45c..fc9bd61 100644
--- a/src/plugin.c
+++ b/src/plugin.c
@@ -484,7 +484,7 @@ checkPluginDeps (CompPlugin *p)
     CompPluginDep *deps = p->vTable->deps;
     int                  nDeps = p->vTable->nDeps;
 
-    while (nDeps--)
+    while (deps && nDeps--)
     {
        switch (deps->rule) {
        case CompPluginRuleBefore:
@@ -537,6 +537,7 @@ pushPlugin (CompPlugin *p)
        return FALSE;
     }
 
+    if (p->vTable->features)
     for (i = 0; i < p->vTable->nFeatures; i++)
     {
        plugin = findActivePluginWithFeature 
(p->vTable->features[i].name, 0);


More information about the compiz mailing list