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 e03088ebe24cd8c12d4389687318c954953291a7 (commit)
via bc4f3352b65aa2ffd96b26d8a41ae19f2584882e (commit)
via c8ea949b1aad9e019141d67092304cbb7db5bf1a (commit)
via 6ef343ed8795532c8936889a42873735157f0bae (commit)
via 032f6587d9fba057744209bc5b3b819b5bfd6b08 (commit)
via a93570e5be7c6a2493bc8555da4a31e889de9210 (commit)
via d72e6d415a78972e9085841545f5de58e931b4f3 (commit)
via 04404bf47c4eed536dde614333eb83b923b3ae59 (commit)
via ae078991221b32367f98754e632021d3975827aa (commit)
via 15db368291419e523d6787d5c968e312b1211b55 (commit)
via ba8cd2abe47e30344cbeb99dcc7cf22d9730f4d3 (commit)
via 8d09af51b831bb3ae7ddc3d4599e82739d41d2ca (commit)
from 2086eefb7e5c658bf0f99feb2aa4b118b188e2b1 (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/e03088ebe24cd8c12d4389687318c954953291a7
commit e03088ebe24cd8c12d4389687318c954953291a7
Author: Christophe CURIS <[email protected]>
Date: Sat Apr 25 12:46:45 2015 +0200
wmaker: fix non-portable int argument for printf in error message
The original code assumed that the sizeof returns a long int type, which is
true on 64 bits platform but not on 32 bits platforms, as pointed by gcc.
The new code does an explicit conversions to 'int' (which should be enough
for that case) so the format specifier in printf will always be ok,
whatever platform Window Maker is compiled for.
Signed-off-by: Christophe CURIS <[email protected]>
diff --git a/po/nl.po b/po/nl.po
index 35cb850..674c642 100644
--- a/po/nl.po
+++ b/po/nl.po
@@ -346,9 +346,9 @@ msgstr ""
#: ../src/dialog.c:594
#, c-format
-msgid "full path for file \"%s\" in \"%s\" is longer than %ld bytes, skipped"
+msgid "full path for file \"%s\" in \"%s\" is longer than %d bytes, skipped"
msgstr ""
-"volledig pad voor bestand \"%s\" in \"%s\" is langer dan %ld byte, "
+"volledig pad voor bestand \"%s\" in \"%s\" is langer dan %d byte, "
"overgeslagen"
#: ../src/dialog.c:628
diff --git a/src/dialog.c b/src/dialog.c
index b7b8f53..56cd3db 100644
--- a/src/dialog.c
+++ b/src/dialog.c
@@ -591,8 +591,8 @@ static void listPixmaps(WScreen *scr, WMList *lPtr, const
char *path)
if (wstrlcpy(pbuf, apath, sizeof(pbuf)) >= sizeof(pbuf) ||
wstrlcat(pbuf, "/", sizeof(pbuf)) >= sizeof(pbuf) ||
wstrlcat(pbuf, dentry->d_name, sizeof(pbuf)) >=
sizeof(pbuf)) {
- wwarning(_("full path for file \"%s\" in \"%s\" is
longer than %ld bytes, skipped"),
- dentry->d_name, path, sizeof(pbuf) - 1);
+ wwarning(_("full path for file \"%s\" in \"%s\" is
longer than %d bytes, skipped"),
+ dentry->d_name, path, (int) (sizeof(pbuf) - 1)
);
continue;
}
http://repo.or.cz/w/wmaker-crm.git/commit/bc4f3352b65aa2ffd96b26d8a41ae19f2584882e
commit bc4f3352b65aa2ffd96b26d8a41ae19f2584882e
Author: Christophe CURIS <[email protected]>
Date: Sat Apr 25 12:46:19 2015 +0200
wmaker: fix crash when switching workspace with "Affiche.app"
As reported by Martin Dietze, when switching workspace (mainly with
keyboard shortcut) while the focus was set on a sticky note from the
GNUstep application "Affiche.app" would cause Window Maker to crash.
This crash was due to the application creating its menu with an Omnipresent
state; Window Maker tried to be smart by smartly setting the focus to this
window after the workspace change, unfortunately when removing the window
of the note from the screen the application would decide to remove also the
omnipresent menu (because it is not necessary anymore).
Because we kept a pointer to an outdated WWindow, we would silently corrupt
memory, which would later cause a crash in an unrelated place (fortunately
in this case it happened quite soon).
This patch adds a check to make sure the window we want to focus is still
a valid one, and if it is not we just ignore it to fall back on another
mechanism already in place for picking the window to focus.
Signed-off-by: Christophe CURIS <[email protected]>
diff --git a/src/workspace.c b/src/workspace.c
index 380ffec..69db16c 100644
--- a/src/workspace.c
+++ b/src/workspace.c
@@ -586,6 +586,26 @@ void wWorkspaceForceChange(WScreen * scr, int workspace)
if (!foc)
foc = foc2;
+ /*
+ * Check that the window we want to focus still exists, because
the application owning it
+ * could decide to unmap/destroy it in response to unmap any of
its other window following
+ * the workspace change, this happening during our
'ProcessPendingEvents' loop.
+ */
+ if (foc != NULL) {
+ WWindow *parse;
+ Bool found;
+
+ found = False;
+ for (parse = scr->focused_window; parse != NULL; parse
= parse->prev) {
+ if (parse == foc) {
+ found = True;
+ break;
+ }
+ }
+ if (!found)
+ foc = NULL;
+ }
+
if (scr->focused_window->flags.mapped && !foc) {
foc = scr->focused_window;
}
http://repo.or.cz/w/wmaker-crm.git/commit/c8ea949b1aad9e019141d67092304cbb7db5bf1a
commit c8ea949b1aad9e019141d67092304cbb7db5bf1a
Author: Christophe CURIS <[email protected]>
Date: Sat Apr 25 12:44:29 2015 +0200
wmaker: converted macro 'SAME' into a static function
There are some risks associated with the way arguments are used in macros,
and using a function also allows check on the type of arguments and leaves
more room to the compiler for making the best optimisation choice; it also
allows writing easier to read code (and thus, to maintain).
As a side effect, this should also help Coverity in avoiding false positive
bug reports (like #109605 and #109607).
Signed-off-by: Christophe CURIS <[email protected]>
diff --git a/src/session.c b/src/session.c
index d55732f..2af8fd0 100644
--- a/src/session.c
+++ b/src/session.c
@@ -415,7 +415,19 @@ static WSavedState *getWindowState(WScreen * scr,
WMPropList * win_state)
return state;
}
-#define SAME(x, y) (((x) && (y) && !strcmp((x), (y))) || (!(x) && !(y)))
+static inline int is_same(const char *x, const char *y)
+{
+ if ((x == NULL) && (y == NULL))
+ return 1;
+
+ if ((x == NULL) || (y == NULL))
+ return 0;
+
+ if (strcmp(x, y) == 0)
+ return 1;
+ else
+ return 0;
+}
void wSessionRestoreState(WScreen *scr)
{
@@ -503,8 +515,10 @@ void wSessionRestoreState(WScreen *scr)
if (dock != NULL) {
for (j = 0; j < dock->max_icons; j++) {
btn = dock->icon_array[j];
- if (btn && SAME(instance, btn->wm_instance) &&
- SAME(class, btn->wm_class) && SAME(command,
btn->command) && !btn->launching) {
+ if (btn && is_same(instance, btn->wm_instance)
&&
+ is_same(class, btn->wm_class) &&
+ is_same(command, btn->command) &&
+ !btn->launching) {
found = 1;
break;
}
diff --git a/src/window.c b/src/window.c
index 121cd16..7cbad9c 100644
--- a/src/window.c
+++ b/src/window.c
@@ -2621,7 +2621,19 @@ WMagicNumber wWindowAddSavedState(const char *instance,
const char *class,
return wstate;
}
-#define SAME(x, y) (((x) && (y) && !strcmp((x), (y))) || (!(x) && !(y)))
+static inline int is_same(const char *x, const char *y)
+{
+ if ((x == NULL) && (y == NULL))
+ return 1;
+
+ if ((x == NULL) || (y == NULL))
+ return 0;
+
+ if (strcmp(x, y) == 0)
+ return 1;
+ else
+ return 0;
+}
WMagicNumber wWindowGetSavedState(Window win)
{
@@ -2637,8 +2649,9 @@ WMagicNumber wWindowGetSavedState(Window win)
if (PropGetWMClass(win, &class, &instance)) {
while (wstate) {
- if (SAME(instance, wstate->instance) &&
- SAME(class, wstate->class) && SAME(command,
wstate->command)) {
+ if (is_same(instance, wstate->instance) &&
+ is_same(class, wstate->class) &&
+ is_same(command, wstate->command)) {
break;
}
wstate = wstate->next;
http://repo.or.cz/w/wmaker-crm.git/commit/6ef343ed8795532c8936889a42873735157f0bae
commit 6ef343ed8795532c8936889a42873735157f0bae
Author: Christophe CURIS <[email protected]>
Date: Sat Apr 25 12:44:28 2015 +0200
WUtil: fix improper use of de-allocated variable (Coverity #109618)
As pointed by Coverity, the variable 'path_dst' was first free'd, then it
was used in the 'unlink' function.
This patch fixes the call order to de-allocate the string only when it is
no more needed.
Signed-off-by: Christophe CURIS <[email protected]>
diff --git a/WINGs/findfile.c b/WINGs/findfile.c
index b5f1b1f..a1e1b02 100644
--- a/WINGs/findfile.c
+++ b/WINGs/findfile.c
@@ -513,9 +513,9 @@ int wcopy_file(const char *dest_dir, const char *src_file,
const char *dest_file
werror(_("could not close the file \"%s\": %s"), path_dst,
strerror(errno));
cleanup_and_return_failure:
free(buffer);
- wfree(path_dst);
close(fd_src);
unlink(path_dst);
+ wfree(path_dst);
return -1;
}
http://repo.or.cz/w/wmaker-crm.git/commit/032f6587d9fba057744209bc5b3b819b5bfd6b08
commit 032f6587d9fba057744209bc5b3b819b5bfd6b08
Author: Christophe CURIS <[email protected]>
Date: Sat Apr 25 12:44:27 2015 +0200
WINGs: remove useless function call in WColorPanel (Coverity #109617)
As reported by Coverity, the function 'customSetPalette' is making a call
to 'WMGetPopUpButtonSelectedItem', but this function does nothing to the
widget but only return a value, which is not used at all, so this patch
removes the call to the function.
Signed-off-by: Christophe CURIS <[email protected]>
diff --git a/WINGs/wcolorpanel.c b/WINGs/wcolorpanel.c
index f23c91d..8aea1df 100644
--- a/WINGs/wcolorpanel.c
+++ b/WINGs/wcolorpanel.c
@@ -2867,8 +2867,6 @@ static void customSetPalette(W_ColorPanel * panel)
panel->palXRatio = (double)(panel->customPaletteImg->width) /
(double)(customPaletteWidth);
panel->palYRatio = (double)(panel->customPaletteImg->height) /
(double)(customPaletteHeight);
-
- WMGetPopUpButtonSelectedItem(panel->customPaletteHistoryBtn);
}
static void customPalettePositionSelection(W_ColorPanel * panel, int x, int y)
http://repo.or.cz/w/wmaker-crm.git/commit/a93570e5be7c6a2493bc8555da4a31e889de9210
commit a93570e5be7c6a2493bc8555da4a31e889de9210
Author: Christophe CURIS <[email protected]>
Date: Sat Apr 25 12:44:26 2015 +0200
wmaker: remove useless null pointer check (Coverity #109612)
As pointed by Coverity, the pointer in wwin->frame have already been
dereferenced many times in the function, so it is useless to include a
check later; removing it makes the code smaller thus easier to maintain.
Signed-off-by: Christophe CURIS <[email protected]>
diff --git a/src/actions.c b/src/actions.c
index 4e87746..1d46b03 100644
--- a/src/actions.c
+++ b/src/actions.c
@@ -1155,7 +1155,7 @@ void wIconifyWindow(WWindow *wwin)
const char *title;
char title_buf[32];
- if (wwin->frame && wwin->frame->title) {
+ if (wwin->frame->title) {
title = wwin->frame->title;
} else {
snprintf(title_buf,
sizeof(title_buf), "(id=0x%lx)", wwin->client_win);
http://repo.or.cz/w/wmaker-crm.git/commit/d72e6d415a78972e9085841545f5de58e931b4f3
commit d72e6d415a78972e9085841545f5de58e931b4f3
Author: Christophe CURIS <[email protected]>
Date: Sat Apr 25 12:44:25 2015 +0200
wmaker: remove non-necessary allocation (Coverity #109609)
As pointed by Coverity, there was a memory leak because the buffer used to
create the wmsetbg command is allocated twice.
Because it is not really necessary to call 'wmalloc' for such a small case
(it is not efficient and participates to memory fragmentation), this patch
replaces the dynamic memory allocation by a buffer on the stack, which also
solves to de-allocation issue.
Signed-off-by: Christophe CURIS <[email protected]>
diff --git a/src/defaults.c b/src/defaults.c
index ee027dc..b6e855c 100644
--- a/src/defaults.c
+++ b/src/defaults.c
@@ -3088,23 +3088,21 @@ static int setWorkspaceBack(WScreen * scr,
WDefaultEntry * entry, void *tdata, v
}
}
} else if (WMGetPropListItemCount(value) > 0) {
- char *command;
char *text;
char *dither;
int len;
text = WMGetPropListDescription(value, False);
len = strlen(text) + 40;
- command = wmalloc(len);
dither = wPreferences.no_dithering ? "-m" : "-d";
if (!strchr(text, '\'') && !strchr(text, '\\')) {
- command = wmalloc(len);
+ char command[len];
+
if (wPreferences.smooth_workspace_back)
snprintf(command, len, "wmsetbg %s -S -p '%s'
&", dither, text);
else
snprintf(command, len, "wmsetbg %s -p '%s' &",
dither, text);
ExecuteShellCommand(scr, command);
- wfree(command);
} else
wwarning(_("Invalid arguments for background \"%s\""),
text);
wfree(text);
http://repo.or.cz/w/wmaker-crm.git/commit/04404bf47c4eed536dde614333eb83b923b3ae59
commit 04404bf47c4eed536dde614333eb83b923b3ae59
Author: Christophe CURIS <[email protected]>
Date: Sat Apr 25 12:44:24 2015 +0200
wmaker: fix memory leak in the Workspace Map if there is no workspace
(Coverity #109608)
As pointed by Coverity, there is a safety check on the number of workspace
which aborts the function, but the storage memory have already been
allocated so it would leak this buffer.
The case where the number of workspace is 0 is probably not supposed to
happen (there should always be at least 1 workspace, the current one), but
it is better to keep safety checks, so this patch is moving the check at
the beginning so no leak will occur.
Signed-off-by: Christophe CURIS <[email protected]>
diff --git a/src/wsmap.c b/src/wsmap.c
index e2b6747..3e84c98 100644
--- a/src/wsmap.c
+++ b/src/wsmap.c
@@ -372,16 +372,18 @@ static void create_mini_workspace(WScreen *scr,
WWorkspaceMap *wsmap, W_Workspac
static WWorkspaceMap *create_workspace_map(WScreen *scr, W_WorkspaceMap
*wsmap_array, int edge)
{
- WWorkspaceMap *wsmap = wmalloc(sizeof(WWorkspaceMap));
+ WWorkspaceMap *wsmap;
+
+ if (scr->workspace_count == 0)
+ return NULL;
+
+ wsmap = wmalloc(sizeof(*wsmap));
wsmap->border_width = 5;
wsmap->edge = edge;
wsmap->mini_workspace_width = scr->scr_width / WORKSPACE_MAP_RATIO;
wsmap->mini_workspace_height = scr->scr_height / WORKSPACE_MAP_RATIO;
- if (scr->workspace_count == 0)
- return NULL;
-
wsmap->scr = scr;
wsmap->win = WMCreateWindow(scr->wmscreen, "wsmap");
wsmap->wswidth = WidthOfScreen(DefaultScreenOfDisplay(dpy));
http://repo.or.cz/w/wmaker-crm.git/commit/ae078991221b32367f98754e632021d3975827aa
commit ae078991221b32367f98754e632021d3975827aa
Author: Christophe CURIS <[email protected]>
Date: Sat Apr 25 12:44:23 2015 +0200
wmaker: fix incorrect size for memory allocation (Coverity #50207)
As pointed by Coverity, when increasing the size of the array allocated to
store the pointers to menus in a cascaded menu, the incorrect value was
used in argument to the sizeof which lead to over-allocating memory.
This patch replaces the name of the structure (which should have been the
pointer type) by the variable actually being used, fixing the size issue
and making maintainability easier by tracking the type of the variable
which is less prone to bugs in case of change.
Signed-off-by: Christophe CURIS <[email protected]>
diff --git a/src/menu.c b/src/menu.c
index 8322dbb..83eb804 100644
--- a/src/menu.c
+++ b/src/menu.c
@@ -312,10 +312,10 @@ void wMenuEntrySetCascade(WMenu * menu, WMenuEntry *
entry, WMenu * cascade)
if (!done) {
entry->cascade = menu->cascade_no;
- menu->cascades = wrealloc(menu->cascades, sizeof(WMenu) *
(menu->cascade_no + 1));
+ menu->cascades = wrealloc(menu->cascades,
sizeof(menu->cascades[0]) * (menu->cascade_no + 1));
menu->cascades[menu->cascade_no++] = cascade;
- brother->cascades = wrealloc(brother->cascades, sizeof(WMenu) *
(brother->cascade_no + 1));
+ brother->cascades = wrealloc(brother->cascades,
sizeof(brother->cascades[0]) * (brother->cascade_no + 1));
brother->cascades[brother->cascade_no++] = cascade->brother;
}
http://repo.or.cz/w/wmaker-crm.git/commit/15db368291419e523d6787d5c968e312b1211b55
commit 15db368291419e523d6787d5c968e312b1211b55
Author: Christophe CURIS <[email protected]>
Date: Sat Apr 25 12:44:22 2015 +0200
WINGs: fix memory leak in WMSubtractPLDictionaries (Coverity #50128)
As pointed by Coverity, a temporary proplist is created with the list of
keys to be removed from the source proplist, but this temporary proplist
was not released at the end, leaking memory.
Signed-off-by: Christophe CURIS <[email protected]>
diff --git a/WINGs/proplist.c b/WINGs/proplist.c
index 28a3ae2..5f68eac 100644
--- a/WINGs/proplist.c
+++ b/WINGs/proplist.c
@@ -1213,6 +1213,7 @@ WMPropList *WMSubtractPLDictionaries(WMPropList * dest,
WMPropList * source, Boo
for (i = 0; i < WMGetArrayItemCount(keys->d.array); i++) {
WMRemoveFromPLDictionary(dest,
WMGetFromArray(keys->d.array, i));
}
+ WMReleasePropList(keys);
return dest;
}
http://repo.or.cz/w/wmaker-crm.git/commit/ba8cd2abe47e30344cbeb99dcc7cf22d9730f4d3
commit ba8cd2abe47e30344cbeb99dcc7cf22d9730f4d3
Author: Christophe CURIS <[email protected]>
Date: Sat Apr 25 12:44:21 2015 +0200
Handle NULL pointer as good as possible (Coverity #50099)
As pointed by Coverity, in the "Configuration" panel of WPrefs there are
some images loaded, but if the images cannot be loaded correctly then the
returned NULL pointer can crash the application as it is dereferenced in
further function calls.
To solve this case, this patch is adding a NULL pointer check in the
functions RScaleImage (wrlib) and WMCreatePixmapFromRImage (WINGs), so both
can accept that NULL pointer to also return NULL, which means the existing
check for "icon == NULL" in the WPrefs code will be useful.
Signed-off-by: Christophe CURIS <[email protected]>
diff --git a/WINGs/wpixmap.c b/WINGs/wpixmap.c
index 272e56a..5ad311c 100644
--- a/WINGs/wpixmap.c
+++ b/WINGs/wpixmap.c
@@ -85,6 +85,9 @@ WMPixmap *WMCreatePixmapFromRImage(WMScreen * scrPtr, RImage
* image, int thresh
WMPixmap *pixPtr;
Pixmap pixmap, mask;
+ if (image == NULL)
+ return NULL;
+
if (!RConvertImageMask(scrPtr->rcontext, image, &pixmap, &mask,
threshold)) {
return NULL;
}
diff --git a/wrlib/scale.c b/wrlib/scale.c
index 0f5952c..9461233 100644
--- a/wrlib/scale.c
+++ b/wrlib/scale.c
@@ -52,6 +52,9 @@ RImage *RScaleImage(RImage * image, unsigned new_width,
unsigned new_height)
unsigned char *d;
RImage *img;
+ if (image == NULL)
+ return NULL;
+
if (new_width == image->width && new_height == image->height)
return RCloneImage(image);
http://repo.or.cz/w/wmaker-crm.git/commit/8d09af51b831bb3ae7ddc3d4599e82739d41d2ca
commit 8d09af51b831bb3ae7ddc3d4599e82739d41d2ca
Author: Christophe CURIS <[email protected]>
Date: Sat Apr 25 12:44:20 2015 +0200
wmaker: check return value for XGetWindowAttributes (Coverity #50032)
As reported by Coverity, the return value for XGetWindowAttributes is
usually checked in many places, because it is a good practice to ensure
that it did work, but it was not checked when called in the function
'wClientCheckProperty'.
Signed-off-by: Christophe CURIS <[email protected]>
diff --git a/src/client.c b/src/client.c
index 99ed445..9af875c 100644
--- a/src/client.c
+++ b/src/client.c
@@ -483,8 +483,8 @@ void wClientCheckProperty(WWindow * wwin, XPropertyEvent *
event)
int foo;
unsigned bar;
- XGetWindowAttributes(dpy, wwin->client_win, &attribs);
- wClientGetNormalHints(wwin, &attribs, False, &foo,
&foo, &bar, &bar);
+ if (XGetWindowAttributes(dpy, wwin->client_win,
&attribs) != 0)
+ wClientGetNormalHints(wwin, &attribs, False,
&foo, &foo, &bar, &bar);
/* TODO: should we check for consistency of the current
* size against the new geometry hints? */
}
-----------------------------------------------------------------------
Summary of changes:
WINGs/findfile.c | 2 +-
WINGs/proplist.c | 1 +
WINGs/wcolorpanel.c | 2 --
WINGs/wpixmap.c | 3 +++
po/nl.po | 4 ++--
src/actions.c | 2 +-
src/client.c | 4 ++--
src/defaults.c | 6 ++----
src/dialog.c | 4 ++--
src/menu.c | 4 ++--
src/session.c | 20 +++++++++++++++++---
src/window.c | 19 ++++++++++++++++---
src/workspace.c | 20 ++++++++++++++++++++
src/wsmap.c | 10 ++++++----
wrlib/scale.c | 3 +++
15 files changed, 78 insertions(+), 26 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].