[compiz] [patch] fix crash in ini plugin

Randolph Chung randolph at tausq.org
Thu Jan 31 12:27:50 PST 2008


The ini plugin segfaults on startup. The following patch fixes it. Not
sure why this hasn't been caught before - i guess not many people use
the ini plugin.

Please apply.

randolph

diff --git a/plugins/ini.c b/plugins/ini.c
index d58f671..2d3c2dd 100644
--- a/plugins/ini.c
+++ b/plugins/ini.c
@@ -377,7 +377,7 @@ iniParseLine (char *line, char **optionName, char **optionValue)
     if (*optionName)
     {
        strncpy (*optionName, line, length);
-       *optionName[length] = 0;
+       (*optionName)[length] = 0;
     }
     splitPos++;
     optionLength = strlen (splitPos);
@@ -387,7 +387,7 @@ iniParseLine (char *line, char **optionName, char **optionValue)
     if (*optionValue)
     {
       strncpy (*optionValue, splitPos, optionLength);
-      *optionValue[optionLength] = 0;
+      (*optionValue)[optionLength] = 0;
     }
     return TRUE;
 }


More information about the compiz mailing list