[compiz] [patch] fix crash in ini plugin

Artur arus at poczta.onet.pl
Sun Feb 3 23:17:58 PST 2008


I have always used ini plugin and it never crashed on me.
Please make sure, that the patch doesn't break anything before applying it. The bug may be, for example, compiler dependent.

Regards.
Artur

W dniu 2008-01-31 21:27, Randolph Chung pisze:
> 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