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  76725a019de07e59b31fe680c4e86fcb49172246 (commit)
       via  f34f64ca89220f894048f1df228fe7e6905f03c5 (commit)
       via  a2402b6f14774ccebf6ea78732d08771d2946943 (commit)
       via  e7e99c5d9a92d24d89e4b2a9bfaae222ed42c092 (commit)
       via  f174e9ca105025174a1870cf8333cee139fa8e84 (commit)
       via  955b5c2bc338d95fe103acc167ba92ba58f310d9 (commit)
       via  0896ae055c092dd13eb2668ff98221350a0fbddd (commit)
       via  46e45554ff4806e60f4291ce88ef77420373a388 (commit)
       via  4b721d04c74876bce93e22650bbe085c2f703758 (commit)
       via  8c3fe490b25be322c5af5fd1035043e20a8d83fc (commit)
       via  c5744aaa8b047f0f3f58422a00ba3f03f0d2912b (commit)
      from  db9f5c9658b5b97939fdb01407c2388cb99cc416 (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/76725a019de07e59b31fe680c4e86fcb49172246

commit 76725a019de07e59b31fe680c4e86fcb49172246
Author: Christophe CURIS <[email protected]>
Date:   Sat May 31 19:58:49 2014 +0200

    WPrefs: add warning when renderTexture encounters some unknow settings
    
    Having the warning displayed will help devs to understand what is going
    on and where to look at for a fix.
    
    Signed-off-by: Christophe CURIS <[email protected]>

diff --git a/WPrefs.app/Appearance.c b/WPrefs.app/Appearance.c
index 05354952..2d5acbe6 100644
--- a/WPrefs.app/Appearance.c
+++ b/WPrefs.app/Appearance.c
@@ -567,6 +567,7 @@ static Pixmap renderTexture(WMScreen * scr, WMPropList * 
texture, int width, int
                        style = RHorizontalGradient;
                        break;
                default:
+                       wwarning("unknow direction in '%s', falling back to 
diagonal", type);
                case 'D':
                        style = RDiagonalGradient;
                        break;
@@ -592,6 +593,7 @@ static Pixmap renderTexture(WMScreen * scr, WMPropList * 
texture, int width, int
                        style = RHorizontalGradient;
                        break;
                default:
+                       wwarning("unknow direction in '%s', falling back to 
diagonal", type);
                case 'D':
                        style = RDiagonalGradient;
                        break;
@@ -625,6 +627,7 @@ static Pixmap renderTexture(WMScreen * scr, WMPropList * 
texture, int width, int
                        style = RHorizontalGradient;
                        break;
                default:
+                       wwarning("unknow direction in '%s', falling back to 
diagonal", type);
                case 'D':
                        style = RDiagonalGradient;
                        break;
@@ -669,6 +672,11 @@ static Pixmap renderTexture(WMScreen * scr, WMPropList * 
texture, int width, int
                        image = RScaleImage(timage, width, height);
                        RReleaseImage(timage);
                        break;
+
+               default:
+                       wwarning("type '%s' in not a supported type for a 
texture", type);
+                       RReleaseImage(timage);
+                       return None;
                }
        }
 

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

commit f34f64ca89220f894048f1df228fe7e6905f03c5
Author: Christophe CURIS <[email protected]>
Date:   Sat May 31 19:58:48 2014 +0200

    WPrefs: fix NULL pointer handling when getting the Modifiers (Coverity 
#50200)
    
    As pointed by Coverity, the allocated value returned by XGetModifierMapping
    is assumed to be non-NULL everywhere except when releasing it.
    Removed this last check (useless) and added a little check at the beginning
    to avoid an (improbable) crash.
    
    Signed-off-by: Christophe CURIS <[email protected]>

diff --git a/WPrefs.app/xmodifier.c b/WPrefs.app/xmodifier.c
index 226652e5..1845ada4 100644
--- a/WPrefs.app/xmodifier.c
+++ b/WPrefs.app/xmodifier.c
@@ -119,7 +119,7 @@ static void x_reset_modifier_mapping(Display * display)
        int super_bit = 0;
        int alt_bit = 0;
        int mode_bit = 0;
-       XModifierKeymap *x_modifier_keymap = XGetModifierMapping(display);
+       XModifierKeymap *x_modifier_keymap;
 
 #define modwarn(name,old,other)                                                
             wwarning ("%s (0x%x) generates %s, which is generated by %s.",     
        @@ -155,6 +155,12 @@ static void x_reset_modifier_mapping(Display * 
display)
     else                                                                       
     old = modifier_index;
 
+       x_modifier_keymap = XGetModifierMapping(display);
+       if (x_modifier_keymap == NULL) {
+               wwarning("XGetModifierMapping returned NULL, there is no 
modifiers or no memory.n");
+               return;
+       }
+
        mkpm = x_modifier_keymap->max_keypermod;
        for (modifier_index = 0; modifier_index < 8; modifier_index++)
                for (modifier_key = 0; modifier_key < mkpm; modifier_key++) {
@@ -270,8 +276,7 @@ static void x_reset_modifier_mapping(Display * display)
        AltIndex = alt_bit;
        ModeIndex = mode_bit;
 
-       if (x_modifier_keymap != NULL)
-               XFreeModifiermap(x_modifier_keymap);
+       XFreeModifiermap(x_modifier_keymap);
 }
 
 int ModifierFromKey(Display * dpy, const char *key)

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

commit a2402b6f14774ccebf6ea78732d08771d2946943
Author: Christophe CURIS <[email protected]>
Date:   Sat May 31 19:58:47 2014 +0200

    WPrefs: fix memory leak when saving window handling settings (Coverity 
#50158)
    
    As pointed by Coverity, the functions WMCreatePLString return a newly
    allocated WMPropList, which must be released when not needed anymore.
    
    Signed-off-by: Christophe CURIS <[email protected]>

diff --git a/WPrefs.app/WindowHandling.c b/WPrefs.app/WindowHandling.c
index 9d7ab54d..0976b17d 100644
--- a/WPrefs.app/WindowHandling.c
+++ b/WPrefs.app/WindowHandling.c
@@ -222,7 +222,8 @@ static void showData(_Panel * panel)
 static void storeData(_Panel * panel)
 {
        WMPropList *arr;
-       char x[16], y[16];
+       WMPropList *x, *y;
+       char buf[16];
 
        SetBoolForKey(WMGetButtonSelected(panel->miconB), "NoWindowOverIcons");
        SetBoolForKey(WMGetButtonSelected(panel->mdockB), "NoWindowOverDock");
@@ -234,9 +235,13 @@ static void storeData(_Panel * panel)
        SetBoolForKey(WMGetButtonSelected(panel->tranB), 
"OpenTransientOnOwnerWorkspace");
 
        SetStringForKey(placements[WMGetPopUpButtonSelectedItem(panel->placP)], 
"WindowPlacement");
-       sprintf(x, "%i", WMGetSliderValue(panel->hsli));
-       sprintf(y, "%i", WMGetSliderValue(panel->vsli));
-       arr = WMCreatePLArray(WMCreatePLString(x), WMCreatePLString(y), NULL);
+       sprintf(buf, "%i", WMGetSliderValue(panel->hsli));
+       x = WMCreatePLString(buf);
+       sprintf(buf, "%i", WMGetSliderValue(panel->vsli));
+       y = WMCreatePLString(buf);
+       arr = WMCreatePLArray(x, y, NULL);
+       WMReleasePropList(x);
+       WMReleasePropList(y);
        SetObjectForKey(arr, "WindowPlaceOrigin");
 
        SetIntegerForKey(WMGetSliderValue(panel->resS), "EdgeResistance");

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

commit e7e99c5d9a92d24d89e4b2a9bfaae222ed42c092
Author: Christophe CURIS <[email protected]>
Date:   Sat May 31 19:58:46 2014 +0200

    WPrefs: fix memory leak when editing a delay for the dock (Coverity #50156)
    
    As reported by Coverity, the return string of WMGetTextFieldText is
    malloced so it needs to be freed.
    
    Signed-off-by: Christophe CURIS <[email protected]>

diff --git a/WPrefs.app/Docks.c b/WPrefs.app/Docks.c
index 2a5265aa..84049419 100644
--- a/WPrefs.app/Docks.c
+++ b/WPrefs.app/Docks.c
@@ -120,6 +120,7 @@ static void autoDelayChanged(void *observerData, 
WMNotification *notification)
                }
                char *value = WMGetTextFieldText(anAutoDelayT);
                adjustButtonSelectionBasedOnValue(panel, row, value);
+               free(value);
                return;
        }
 }

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

commit f174e9ca105025174a1870cf8333cee139fa8e84
Author: Christophe CURIS <[email protected]>
Date:   Sat May 31 19:58:45 2014 +0200

    WPrefs: fix memory leak when saving settings (Coverity #50140 + #50157 + 
#50159)
    
    As pointed by Coverity, the string returned by 'WMGetTextFieldText' is
    allocated dynamically, so it must be freed when not needed anymore.
    
    Signed-off-by: Christophe CURIS <[email protected]>

diff --git a/WPrefs.app/Docks.c b/WPrefs.app/Docks.c
index 7d54f30c..2a5265aa 100644
--- a/WPrefs.app/Docks.c
+++ b/WPrefs.app/Docks.c
@@ -292,7 +292,11 @@ static void storeData(_Panel *panel)
        int i;
        for (i = 0; i < 4; i++)
        {
-               SetStringForKey(WMGetTextFieldText(panel->autoDelayT[i]), 
auto_delay[i].key);
+               char *str;
+
+               str = WMGetTextFieldText(panel->autoDelayT[i]);
+               SetStringForKey(str, auto_delay[i].key);
+               wfree(str);
        }
        for (i = 0; i < 3; i++)
        {
diff --git a/WPrefs.app/Focus.c b/WPrefs.app/Focus.c
index 3ee8ec94..ea4b20f2 100644
--- a/WPrefs.app/Focus.c
+++ b/WPrefs.app/Focus.c
@@ -138,6 +138,7 @@ static void storeData(_Panel * panel)
        if (sscanf(str, "%i", &i) != 1)
                i = 0;
        SetIntegerForKey(i, "RaiseDelay");
+       free(str);
 
        SetBoolForKey(WMGetButtonSelected(panel->ignB), "IgnoreFocusClick");
        SetBoolForKey(WMGetButtonSelected(panel->newB), "AutoFocus");
diff --git a/WPrefs.app/MouseSettings.c b/WPrefs.app/MouseSettings.c
index cb767e6c..741bf97b 100644
--- a/WPrefs.app/MouseSettings.c
+++ b/WPrefs.app/MouseSettings.c
@@ -750,6 +750,7 @@ static void storeData(_Panel * panel)
        tmp = WMGetTextFieldText(panel->ddelaT);
        if (sscanf(tmp, "%i", &i) == 1 && i > 0)
                SetIntegerForKey(i, "DoubleClickTime");
+       wfree(tmp);
 
        SetBoolForKey(WMGetButtonSelected(panel->disaB), 
"DisableWSMouseActions");
 

http://repo.or.cz/w/wmaker-crm.git/commit/955b5c2bc338d95fe103acc167ba92ba58f310d9

commit 955b5c2bc338d95fe103acc167ba92ba58f310d9
Author: Christophe CURIS <[email protected]>
Date:   Sat May 31 19:58:44 2014 +0200

    WPrefs: fix memory leak when editing the label of a menu (Coverity #50130)
    
    As pointed by Coverity, the function 'WMGetTextFieldText' already allocates
    memory for its return string, so it is not necessary to wstrdup it.
    
    Signed-off-by: Christophe CURIS <[email protected]>

diff --git a/WPrefs.app/editmenu.c b/WPrefs.app/editmenu.c
index c3cf296a..7a9b29b9 100644
--- a/WPrefs.app/editmenu.c
+++ b/WPrefs.app/editmenu.c
@@ -809,13 +809,9 @@ static void handleEvents(XEvent * event, void *data)
 
 static void stopEditItem(WEditMenu * menu, Bool apply)
 {
-       char *text;
-
        if (apply) {
-               text = WMGetTextFieldText(menu->tfield);
-
                wfree(menu->selectedItem->label);
-               menu->selectedItem->label = wstrdup(text);
+               menu->selectedItem->label = WMGetTextFieldText(menu->tfield);
 
                updateMenuContents(menu);
 

http://repo.or.cz/w/wmaker-crm.git/commit/0896ae055c092dd13eb2668ff98221350a0fbddd

commit 0896ae055c092dd13eb2668ff98221350a0fbddd
Author: Christophe CURIS <[email protected]>
Date:   Sat May 31 19:58:43 2014 +0200

    WPrefs: fix memory leak in loadRImage (Coverity #50107)
    
    As pointed by Coverity, if there is a problem when reading the binary data
    of an RImage from a file, the area allocated to store it would not be
    freed.
    
    Signed-off-by: Christophe CURIS <[email protected]>

diff --git a/WPrefs.app/Appearance.c b/WPrefs.app/Appearance.c
index f67975d9..05354952 100644
--- a/WPrefs.app/Appearance.c
+++ b/WPrefs.app/Appearance.c
@@ -1276,13 +1276,13 @@ static Pixmap loadRImage(WMScreen * scr, const char 
*path)
        }
        image = RCreateImage(w, h, d == 4);
        read_size = w * h * d;
-       if (fread(image->data, 1, read_size, f) != read_size) {
-               fclose(f);
-               return None;
-       }
+       if (fread(image->data, 1, read_size, f) == read_size)
+               RConvertImage(WMScreenRContext(scr), image, &pixmap);
+       else
+               pixmap = None;
+
        fclose(f);
 
-       RConvertImage(WMScreenRContext(scr), image, &pixmap);
        RReleaseImage(image);
 
        return pixmap;

http://repo.or.cz/w/wmaker-crm.git/commit/46e45554ff4806e60f4291ce88ef77420373a388

commit 46e45554ff4806e60f4291ce88ef77420373a388
Author: Christophe CURIS <[email protected]>
Date:   Sat May 31 19:58:42 2014 +0200

    WPrefs: fix memory leak in buildPLFromMenu (Coverity #50105)
    
    As pointed by Coverity, the PLArray that is created to store the return
    value of the function 'processData' can be left allocated if some case
    handling decide to return NULL instead.
    
    Signed-off-by: Christophe CURIS <[email protected]>

diff --git a/WPrefs.app/Menu.c b/WPrefs.app/Menu.c
index 59d407e3..afe8700d 100644
--- a/WPrefs.app/Menu.c
+++ b/WPrefs.app/Menu.c
@@ -1557,7 +1557,7 @@ static WMPropList *processData(const char *title, 
ItemData * data)
        switch (data->type) {
        case ExecInfo:
                if (data->param.exec.command == NULL)
-                       return NULL;
+                       goto return_null;
 #if 1
                if (strpbrk(data->param.exec.command, "&$*|><?`=;")) {
                        s1 = "SHEXEC";
@@ -1607,7 +1607,7 @@ static WMPropList *processData(const char *title, 
ItemData * data)
        case PipeInfo:
        case PLPipeInfo:
                if (!data->param.pipe.command)
-                       return NULL;
+                       goto return_null;
                if (data->type == PLPipeInfo)
                        WMAddToPLArray(item, poplmenu);
                else
@@ -1623,18 +1623,19 @@ static WMPropList *processData(const char *title, 
ItemData * data)
 
        case ExternalInfo:
                if (!data->param.external.path)
-                       return NULL;
+                       goto return_null;
                WMAddToPLArray(item, pomenu);
                WMAddToPLArray(item, 
WMCreatePLString(data->param.external.path));
                break;
 
        case DirectoryInfo:
-               if (!data->param.directory.directory || 
!data->param.directory.command)
-                       return NULL;
                {
                        int l;
                        char *tmp;
 
+                       if (!data->param.directory.directory || 
!data->param.directory.command)
+                               goto return_null;
+
                        l = strlen(data->param.directory.directory);
                        l += strlen(data->param.directory.command);
                        l += 32;
@@ -1665,6 +1666,10 @@ static WMPropList *processData(const char *title, 
ItemData * data)
        }
 
        return item;
+
+ return_null:
+       WMReleasePropList(item);
+       return NULL;
 }
 
 static WMPropList *processSubmenu(WEditMenu * menu)

http://repo.or.cz/w/wmaker-crm.git/commit/4b721d04c74876bce93e22650bbe085c2f703758

commit 4b721d04c74876bce93e22650bbe085c2f703758
Author: Christophe CURIS <[email protected]>
Date:   Sat May 31 19:58:41 2014 +0200

    WPrefs: fix possible crash when saving mouse modifier (Coverity #50098)
    
    As pointed by Coverity, there is a possible NULL pointer dereference in the
    code that extracts the selected modifier (from a popup button list).
    
    The code assumes that there is always a space between the core name of the
    modifier (which is used for saving) and the more user friendly name. This
    is true if the list could be successfully generated in fillModifierPopUp,
    but it may not be the case if that function has to fall-back to the
    default list (XGetModifierMaping failure).
    
    Signed-off-by: Christophe CURIS <[email protected]>

diff --git a/WPrefs.app/MouseSettings.c b/WPrefs.app/MouseSettings.c
index 31d467de..cb767e6c 100644
--- a/WPrefs.app/MouseSettings.c
+++ b/WPrefs.app/MouseSettings.c
@@ -768,7 +768,8 @@ static void storeData(_Panel * panel)
        tmp = WMGetPopUpButtonItem(panel->grabP, 
WMGetPopUpButtonSelectedItem(panel->grabP));
        tmp = wstrdup(tmp);
        p = strchr(tmp, ' ');
-       *p = 0;
+       if (p != NULL)
+               *p = '0';
 
        SetStringForKey(tmp, "ModifierKey");
 

http://repo.or.cz/w/wmaker-crm.git/commit/8c3fe490b25be322c5af5fd1035043e20a8d83fc

commit 8c3fe490b25be322c5af5fd1035043e20a8d83fc
Author: Christophe CURIS <[email protected]>
Date:   Sat May 31 19:58:40 2014 +0200

    WPrefs: fix NULL pointer dereference in the Pixmap/Icon path panel 
(Coverity #50073 + #50150)
    
    As pointed by Coverity, it is possible to dereference the NULL pointer in
    the function 'browseForFile'.
    This should have been reported by the compiler ("possible use of
    uninitialised variable") but the assignation of a default value to the
    variable 'lPtr' hides this, but as the default value is not a good one then
    the code could crash.
    This patch removes the default value, so we may have some info from the
    compiler and handles the case smoothly.
    
    It also fixes a potential memory leak pointed also by Coverity in the
    case where the string returned by WMGetFilePanelFileName would be a 0
    length non-null string.
    
    Signed-off-by: Christophe CURIS <[email protected]>

diff --git a/WPrefs.app/Paths.c b/WPrefs.app/Paths.c
index 86f27a40..101b797d 100644
--- a/WPrefs.app/Paths.c
+++ b/WPrefs.app/Paths.c
@@ -149,22 +149,24 @@ static void browseForFile(WMWidget * w, void *data)
                                len--;
                        }
                        if (len > 0) {
-                               WMList *lPtr = NULL;
+                               WMList *lPtr;
                                int i;
 
                                if (w == panel->icoaB)
                                        lPtr = panel->icoL;
                                else if (w == panel->pixaB)
                                        lPtr = panel->pixL;
+                               else
+                                       goto error_unknow_widget;
 
                                i = WMGetListSelectedItemRow(lPtr);
                                if (i >= 0)
                                        i++;
                                addPathToList(lPtr, i, str);
                                WMSetListBottomPosition(lPtr, 
WMGetListNumberOfRows(lPtr));
-
-                               wfree(str);
                        }
+               error_unknow_widget:
+                       wfree(str);
                }
        }
 }

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

commit c5744aaa8b047f0f3f58422a00ba3f03f0d2912b
Author: Christophe CURIS <[email protected]>
Date:   Sat May 31 19:58:39 2014 +0200

    WPrefs: make fall-back value look like a fall-back value in Texture Panel 
(Coverity #50031)
    
    As pointed by Coverity, the return value of 'sscanf' is not checked, which
    may not be a problem because the fall-back value for 'i' is provided before.
    
    However, if sscanf fails there is no guarantee that all implementation would
    leave 'i' untouched in case of parsing error, and for convenience it is more
    logical to write the code is such a way that the value assignment looks like
    the fall-back value it is.
    
    Signed-off-by: Christophe CURIS <[email protected]>

diff --git a/WPrefs.app/TexturePanel.c b/WPrefs.app/TexturePanel.c
index 9f2b86a5..58e9eccc 100644
--- a/WPrefs.app/TexturePanel.c
+++ b/WPrefs.app/TexturePanel.c
@@ -824,8 +824,8 @@ void SetTexturePanelTexture(TexturePanel * panel, const 
char *name, WMPropList *
                        wfree(panel->imageFile);
                panel->imageFile = 
wstrdup(WMGetFromPLString(WMGetFromPLArray(texture, 1)));
 
-               i = 180;
-               sscanf(WMGetFromPLString(WMGetFromPLArray(texture, 2)), "%i", 
&i);
+               if (sscanf(WMGetFromPLString(WMGetFromPLArray(texture, 2)), 
"%i", &i) != 1)
+                       i = 180;
                WMSetSliderValue(panel->topaS, i);
 
                p = WMGetFromPLArray(texture, 3);

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

Summary of changes:
 WPrefs.app/Appearance.c     |   18 +++++++++++++-----
 WPrefs.app/Docks.c          |    7 ++++++-
 WPrefs.app/Focus.c          |    1 +
 WPrefs.app/Menu.c           |   15 ++++++++++-----
 WPrefs.app/MouseSettings.c  |    4 +++-
 WPrefs.app/Paths.c          |    8 +++++---
 WPrefs.app/TexturePanel.c   |    4 ++--
 WPrefs.app/WindowHandling.c |   13 +++++++++----
 WPrefs.app/editmenu.c       |    6 +-----
 WPrefs.app/xmodifier.c      |   11 ++++++++---
 10 files changed, 58 insertions(+), 29 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