[geany/geany-plugins] 0961ba: git-changebar: Fix writing of color values in the configuration

Colomban Wendling git-noreply at xxxxx
Sat Feb 28 14:06:14 UTC 2015

Branch:      refs/heads/master
Author:      Colomban Wendling <ban at herbesfolles.org>
Committer:   Colomban Wendling <ban at herbesfolles.org>
Date:        Sat, 28 Feb 2015 14:06:14 UTC
Commit:      0961bac7f04cdf770f038246bb666f00cfcf4dad

Log Message:
git-changebar: Fix writing of color values in the configuration

Incorrect variable reference in `sizeof` expression lead to using the
size of a pointer as the length of the buffer.  This used to work on
64 bits systems because the buffer is 8 bytes in length, which happens
to be the size of a pointer on 64 bits systems, but it fails on 32 bits
ones because the size of the pointer is 4 bytes there, which is too
small for what we actually want to write, leading to a truncation of
the value.

Thanks to Mark Burton for discovering the bug and providing a patch!

Modified Paths:

Modified: git-changebar/src/gcb-plugin.c
2 lines changed, 1 insertions(+), 1 deletions(-)
@@ -926,7 +926,7 @@ write_setting_color (GKeyFile      *kf,
   g_return_if_fail (*color <= 0xffffff);
-  g_snprintf (kfval, sizeof value, "#%.6x", *color);
+  g_snprintf (kfval, sizeof kfval, "#%.6x", *color);
   g_key_file_set_value (kf, group, key, kfval);

This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).

More information about the Plugins-Commits mailing list