This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project wmaker-crm.git.

The branch, next has been updated
       via  e498a8bd79403a96dd5b9835b62ce1d1d9116c9f (commit)
      from  d356baebea8b3aeff8b20dd513c81b34f5f3826b (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://repo.or.cz/w/wmaker-crm.git/commit/e498a8bd79403a96dd5b9835b62ce1d1d9116c9f

commit e498a8bd79403a96dd5b9835b62ce1d1d9116c9f
Author: Christophe CURIS <[email protected]>
Date:   Thu May 31 20:26:09 2012 +0200

    Fixed possible off-by-one loops
    
    Due to variable size definitions in the structure, the 'for' loops may
    actually try to work on wrong data. Instead of using hard-coded value,
    we now simply let the compiler give us the number of elements.
    
    This may (or may not) fix a crash reported by Rodolfo kix Garcia.

diff --git a/src/winspector.c b/src/winspector.c
index 37ae0b2..a585710 100644
--- a/src/winspector.c
+++ b/src/winspector.c
@@ -884,7 +884,7 @@ static void revertSettings(WMButton * button, 
InspectorPanel * panel)
 
        wWindowSetupInitialAttributes(wwin, &level, &workspace);
 
-       for (i = 0; i < 11; i++) {
+       for (i = 0; i < (sizeof(panel->attrChk) / sizeof(panel->attrChk[0])); 
i++) {
                int flag = 0;
 
                switch (i) {
@@ -924,7 +924,7 @@ static void revertSettings(WMButton * button, 
InspectorPanel * panel)
                }
                WMSetButtonSelected(panel->attrChk[i], flag);
        }
-       for (i = 0; i < 12; i++) {
+       for (i = 0; i < (sizeof(panel->moreChk) / sizeof(panel->moreChk[0])); 
i++) {
                int flag = 0;
 
                switch (i) {
@@ -970,7 +970,7 @@ static void revertSettings(WMButton * button, 
InspectorPanel * panel)
                WMSetButtonSelected(panel->moreChk[i], flag);
        }
        if (panel->appFrm && wapp) {
-               for (i = 0; i < 3; i++) {
+       for (i = 0; i < (sizeof(panel->appChk) / sizeof(panel->appChk[0])); 
i++) {
                        int flag = 0;
 
                        switch (i) {
@@ -1252,7 +1252,7 @@ static InspectorPanel *createInspectorForWindow(WWindow * 
wwin, int xpos, int yp
        WMMoveWidget(panel->attrFrm, 15, 45);
        WMResizeWidget(panel->attrFrm, frame_width, 250);
 
-       for (i = 0; i < 11; i++) {
+       for (i = 0; i < (sizeof(panel->attrChk) / sizeof(panel->attrChk[0])); 
i++) {
                char *caption = NULL;
                int flag = 0;
                char *descr = NULL;
@@ -1334,13 +1334,7 @@ static InspectorPanel *createInspectorForWindow(WWindow 
* wwin, int xpos, int yp
        WMMoveWidget(panel->moreFrm, 15, 45);
        WMResizeWidget(panel->moreFrm, frame_width, 265);
 
-       for (i = 0;
-#ifdef XKB_BUTTON_HINT
-            i < 12;
-#else
-            i < 11;
-#endif
-            i++) {
+       for (i = 0; i < (sizeof(panel->moreChk) / sizeof(panel->moreChk[0])); 
i++) {
                char *caption = NULL;
                int flag = 0;
                char *descr = NULL;
@@ -1506,7 +1500,7 @@ static InspectorPanel *createInspectorForWindow(WWindow * 
wwin, int xpos, int yp
                WMMoveWidget(panel->appFrm, 15, 50);
                WMResizeWidget(panel->appFrm, frame_width, 240);
 
-               for (i = 0; i < 3; i++) {
+               for (i = 0; i < (sizeof(panel->appChk) / 
sizeof(panel->appChk[0])); i++) {
                        char *caption = NULL;
                        int flag = 0;
                        char *descr = NULL;

-----------------------------------------------------------------------

Summary of changes:
 src/winspector.c |   18 ++++++------------
 1 files changed, 6 insertions(+), 12 deletions(-)


repo.or.cz automatic notification. Contact project admin [email protected]
if you want to unsubscribe, or site admin [email protected] if you receive
no reply.
-- 
wmaker-crm.git ("The Window Maker window manager")


-- 
To unsubscribe, send mail to [email protected].

Reply via email to