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 a24efec61f020b7a693f14d45d09fa331aee62e7 (commit)
via 6397f3403a74511680736e04fce44731156e6e5c (commit)
via 8ed6eacd06d6aa6f831c5c7f04e58e84d38a98ab (commit)
via 54feb499cbd22d748bab8e82bb25039f0bb84d1b (commit)
via d83b5de64413905ea28ca756247a1f8b1308b5f8 (commit)
via 3dea732ccb9876f870a7569759d85a49c23f6084 (commit)
via 243a1924fa61f4c698f09b156db0398834b50d0e (commit)
via 1bd96217090967cb8e0a454c3fcaecd43fb92b3d (commit)
via 8b78681a7fb7e788a4816d692000edf36f5aea5f (commit)
via 7bf256531609c11747a5037e8e8c65a949e9f107 (commit)
via 7542451a046535ba7ed9919dc9610a822c796904 (commit)
via aa8ade1ef1b884c0a338134b6ac1bd3001b8771c (commit)
via 1b00071c266a7beba53be7b7f2e8c808e5bdb8a8 (commit)
via 63733c913316861582f2330c13741ef3862d4d87 (commit)
via c5d4c27a90dfe728e3fdeabd3b3c42e2ec38cca5 (commit)
via b80118fb419107e1af935c61dbe37e6a0db542f7 (commit)
from 4f050ebab997782461d7c6b65dea7b535916329f (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/a24efec61f020b7a693f14d45d09fa331aee62e7
commit a24efec61f020b7a693f14d45d09fa331aee62e7
Author: Christophe CURIS <[email protected]>
Date: Sat Nov 29 16:35:31 2014 +0100
util: use wfree instead of free for consistency
The memory was allocated with wmalloc, so for consistency it should be
freed using wfree. This could be a problem if the user compiled with
support for Boehm GC, or if we later decide to add support for other malloc
libraries.
Signed-off-by: Christophe CURIS <[email protected]>
diff --git a/util/getstyle.c b/util/getstyle.c
index 2b7edb9d..da211acb 100644
--- a/util/getstyle.c
+++ b/util/getstyle.c
@@ -175,7 +175,7 @@ static void findCopyFile(const char *dir, const char *file)
return;
}
wcopy_file(dir, fullPath, fullPath);
- free(fullPath);
+ wfree(fullPath);
}
#define THEME_SUBPATH "/Library/WindowMaker/Themes/"
http://repo.or.cz/w/wmaker-crm.git/commit/6397f3403a74511680736e04fce44731156e6e5c
commit 6397f3403a74511680736e04fce44731156e6e5c
Author: Christophe CURIS <[email protected]>
Date: Sat Nov 29 16:35:30 2014 +0100
util: return from 'findCopyFile' if the source file could not be found
(Coverity #50075)
As pointed by Coverity, the function handles the case where the file to be
copied is not found by properly warning the user and the deleting the
currently built theme directory, but then it continued executing the file
copy that would crash on the null pointer.
This patch just adds the missing return that will avoid the crash.
Signed-off-by: Christophe CURIS <[email protected]>
diff --git a/util/getstyle.c b/util/getstyle.c
index c39d266e..2b7edb9d 100644
--- a/util/getstyle.c
+++ b/util/getstyle.c
@@ -172,6 +172,7 @@ static void findCopyFile(const char *dir, const char *file)
wwarning("Could not find file %s", file);
if (ThemePath)
(void)wrmdirhier(ThemePath);
+ return;
}
wcopy_file(dir, fullPath, fullPath);
free(fullPath);
http://repo.or.cz/w/wmaker-crm.git/commit/8ed6eacd06d6aa6f831c5c7f04e58e84d38a98ab
commit 8ed6eacd06d6aa6f831c5c7f04e58e84d38a98ab
Author: Christophe CURIS <[email protected]>
Date: Sat Nov 29 16:35:29 2014 +0100
WPrefs: fix memory leaks on temporary colours to draw icon's title in
Appearence preview (Coverity #72808, #72810)
Two WMColor were created to draw the background for the title on icons for
iconified windows, in the Appearance panel. As pointed by Coverity, these
colors were not released after use, which this patch fixes.
Signed-off-by: Christophe CURIS <[email protected]>
diff --git a/WPrefs.app/Appearance.c b/WPrefs.app/Appearance.c
index 25f14223..9e0e8a6a 100644
--- a/WPrefs.app/Appearance.c
+++ b/WPrefs.app/Appearance.c
@@ -1624,7 +1624,9 @@ static void updateColorPreviewBox(_Panel * panel, int
elements)
panel->smallFont, 155, 130, 64, 13, WALeft,
_("Icon Text"));
- }
+ WMReleaseColor(light);
+ WMReleaseColor(dim);
+ }
if (elements & (1 << CLIP_COL) || elements & (1 << CCLIP_COL)) {
Pixmap pix;
http://repo.or.cz/w/wmaker-crm.git/commit/54feb499cbd22d748bab8e82bb25039f0bb84d1b
commit 54feb499cbd22d748bab8e82bb25039f0bb84d1b
Author: Christophe CURIS <[email protected]>
Date: Sat Nov 29 16:35:28 2014 +0100
WPrefs: fix memory leak when storing the list of colors in Appearence panel
The name of the color is stored in a newly created PLString which leaks.
This is due to the fact that they are created with a refCount of 1, then
the PLArray in which they are placed increments that count, so at list
destruction the count would return to 1 instead of 0, meaning the
PLString won't be freed.
This patch properly calls WMReleasePropList after addition to the list, so
that the count goes back to 1, which means it will be automatically freed
when the PLArray will be released.
Signed-off-by: Christophe CURIS <[email protected]>
diff --git a/WPrefs.app/Appearance.c b/WPrefs.app/Appearance.c
index 7e22dec9..25f14223 100644
--- a/WPrefs.app/Appearance.c
+++ b/WPrefs.app/Appearance.c
@@ -2222,11 +2222,14 @@ static void prepareForClose(_Panel * panel)
for (i = 0; i < wlengthof(sample_colors); i++) {
WMColor *color;
char *str;
+ WMPropList *pl_color;
color = WMGetColorWellColor(panel->sampW[i]);
str = WMGetColorRGBDescription(color);
- WMAddToPLArray(textureList, WMCreatePLString(str));
+ pl_color = WMCreatePLString(str);
+ WMAddToPLArray(textureList, pl_color);
+ WMReleasePropList(pl_color);
wfree(str);
}
WMSetUDObjectForKey(udb, textureList, "ColorList");
http://repo.or.cz/w/wmaker-crm.git/commit/d83b5de64413905ea28ca756247a1f8b1308b5f8
commit d83b5de64413905ea28ca756247a1f8b1308b5f8
Author: Christophe CURIS <[email protected]>
Date: Sat Nov 29 16:35:27 2014 +0100
wmaker: remove unnecessary check in acceptXDND (Coverity #72817)
As pointed by Coverity, if dock is still null at this point then the
function will return via the previous check, because it is not possible to
have icon_pos >= 0 if dock is null.
This patch removes the check because it complicate the code which is not
recommended for maintainability.
Signed-off-by: Christophe CURIS <[email protected]>
diff --git a/src/xdnd.c b/src/xdnd.c
index 2a73c4b2..afbbd44c 100644
--- a/src/xdnd.c
+++ b/src/xdnd.c
@@ -226,8 +226,7 @@ static Bool acceptXDND(Window window)
}
if (icon_pos < 0)
return False;
- if (!dock)
- return False;
+
if (isAwareXDND(dock->icon_array[icon_pos]->icon->icon_win))
return False;
http://repo.or.cz/w/wmaker-crm.git/commit/3dea732ccb9876f870a7569759d85a49c23f6084
commit 3dea732ccb9876f870a7569759d85a49c23f6084
Author: Christophe CURIS <[email protected]>
Date: Sat Nov 29 16:35:26 2014 +0100
wmaker: removed variable 'done' to prepare return status in
'wNETWMProcessClientMessage'
Using a variable to store the return value that will be used later is not a
good idea, because it forces to track everywhere in the function when
needing to work on the function.
This patch removes the variables and places explicit return if each case,
so on first look it is clear where the code stops.
It also fixes a bug where the function would handle an event but still
returns False (meaning the event was not treated), whose root cause was
coming from the complexity brought by the variable.
Signed-off-by: Christophe CURIS <[email protected]>
diff --git a/src/wmspec.c b/src/wmspec.c
index d2a9555a..d6bb61c6 100644
--- a/src/wmspec.c
+++ b/src/wmspec.c
@@ -1472,7 +1472,6 @@ Bool wNETWMProcessClientMessage(XClientMessageEvent
*event)
{
WScreen *scr;
WWindow *wwin;
- Bool done = True;
#ifdef DEBUG_WMSPEC
wmessage("processClientMessage type %s", XGetAtomName(dpy,
event->message_type));
@@ -1483,6 +1482,8 @@ Bool wNETWMProcessClientMessage(XClientMessageEvent
*event)
/* generic client messages */
if (event->message_type == net_current_desktop) {
wWorkspaceChange(scr, event->data.l[0]);
+ return True;
+
} else if (event->message_type == net_number_of_desktops) {
long value;
@@ -1503,16 +1504,16 @@ Bool wNETWMProcessClientMessage(XClientMessageEvent
*event)
if (rebuild)
updateWorkspaceCount(scr);
}
+ return True;
+
} else if (event->message_type == net_showing_desktop) {
wNETWMShowingDesktop(scr, event->data.l[0]);
+ return True;
+
} else if (event->message_type == net_desktop_names) {
handleDesktopNames(scr);
- } else {
- done = False;
- }
-
- if (done)
return True;
+ }
}
/* window specific client messages */
@@ -1535,12 +1536,16 @@ Bool wNETWMProcessClientMessage(XClientMessageEvent
*event)
wNETWMShowingDesktop(scr, False);
wMakeWindowVisible(wwin);
}
+ return True;
+
} else if (event->message_type == net_close_window) {
if (!WFLAGP(wwin, no_closable)) {
if (wwin->protocols.DELETE_WINDOW)
wClientSendProtocol(wwin,
w_global.atom.wm.delete_window,
w_global.timestamp.last_event);
}
+ return True;
+
} else if (event->message_type == net_wm_state) {
int maximized = wwin->flags.maximized;
long set = event->data.l[0];
@@ -1563,10 +1568,15 @@ Bool wNETWMProcessClientMessage(XClientMessageEvent
*event)
}
}
updateStateHint(wwin, False, False);
+ return True;
+
} else if (event->message_type == net_wm_handled_icons ||
event->message_type == net_wm_icon_geometry) {
updateNetIconInfo(wwin);
+ return True;
+
} else if (event->message_type == net_wm_desktop) {
long desktop = event->data.l[0];
+
if (desktop == -1) {
wWindowSetOmnipresent(wwin, True);
} else {
@@ -1574,11 +1584,10 @@ Bool wNETWMProcessClientMessage(XClientMessageEvent
*event)
wWindowSetOmnipresent(wwin, False);
wWindowChangeWorkspace(wwin, desktop);
}
- } else {
- done = False;
+ return True;
}
- return done;
+ return False;
}
void wNETWMCheckClientHintChange(WWindow *wwin, XPropertyEvent *event)
http://repo.or.cz/w/wmaker-crm.git/commit/243a1924fa61f4c698f09b156db0398834b50d0e
commit 243a1924fa61f4c698f09b156db0398834b50d0e
Author: Christophe CURIS <[email protected]>
Date: Sat Nov 29 16:35:25 2014 +0100
wmaker: fix signedness of variable (Coverity #50082, #50222)
Coverity complain that there can be security issues because the variable
'i' is being modified using untrusted data (coming from a file). This is
probably pessimistic, because in the present case we're talking with the
kernel.
Using the correct signedness for the variable should however keep us safe,
and (I hope) make Coverity happy.
Took opportunity to include an error message in case of read problem
because it can help to debug.
Signed-off-by: Christophe CURIS <[email protected]>
diff --git a/src/event.c b/src/event.c
index bc590fe5..9a8a3e3f 100644
--- a/src/event.c
+++ b/src/event.c
@@ -33,6 +33,7 @@
#include <string.h>
#include <strings.h>
#include <time.h>
+#include <errno.h>
#include <X11/Xlib.h>
#include <X11/Xutil.h>
@@ -294,7 +295,8 @@ void DispatchEvent(XEvent * event)
*/
static void handle_inotify_events(void)
{
- ssize_t eventQLength, i = 0;
+ ssize_t eventQLength;
+ size_t i = 0;
/* Make room for at lease 5 simultaneous events, with path + filenames
*/
char buff[ (sizeof(struct inotify_event) + NAME_MAX + 1) * 5 ];
/* Check config only once per read of the event queue */
@@ -310,6 +312,11 @@ static void handle_inotify_events(void)
eventQLength = read(w_global.inotify.fd_event_queue,
buff, sizeof(buff) );
+ if (eventQLength < 0) {
+ wwarning(_("read problem when trying to get INotify event:
%s"), strerror(errno));
+ return;
+ }
+
/* check what events occured */
/* Should really check wd here too, but for now we only have one watch!
*/
while (i < eventQLength) {
http://repo.or.cz/w/wmaker-crm.git/commit/1bd96217090967cb8e0a454c3fcaecd43fb92b3d
commit 1bd96217090967cb8e0a454c3fcaecd43fb92b3d
Author: Christophe CURIS <[email protected]>
Date: Sat Nov 29 16:35:24 2014 +0100
wmaker: do not store return value that we don't use (Coverity #50252)
As pointed by Coverity, we store a value into the variable 'entry' but we
never use it later, although we re-use the variable.
For the maintainability of the code, it is not really good as it could
mislead into thinking the value could be used, so this patch removes the
assignation.
Signed-off-by: Christophe CURIS <[email protected]>
diff --git a/src/dock.c b/src/dock.c
index 8b135689..8853fa3f 100644
--- a/src/dock.c
+++ b/src/dock.c
@@ -1220,9 +1220,9 @@ static WMenu *dockMenuCreate(WScreen *scr, int type)
scr->dock_pos_menu = makeDockPositionMenu(scr);
wMenuEntrySetCascade(menu, entry, scr->dock_pos_menu);
- if (!wPreferences.flags.nodrawer) {
- entry = wMenuAddCallback(menu, _("Add a drawer"),
addADrawerCallback, NULL);
- }
+ if (!wPreferences.flags.nodrawer)
+ wMenuAddCallback(menu, _("Add a drawer"),
addADrawerCallback, NULL);
+
} else {
if (type == WM_CLIP)
entry = wMenuAddCallback(menu, _("Clip Options"), NULL,
NULL);
http://repo.or.cz/w/wmaker-crm.git/commit/8b78681a7fb7e788a4816d692000edf36f5aea5f
commit 8b78681a7fb7e788a4816d692000edf36f5aea5f
Author: Christophe CURIS <[email protected]>
Date: Sat Nov 29 16:35:23 2014 +0100
wmaker: remove intermediate strcpy in updateWorkspaceMenu (Coverity #50213)
Coverity warned because the 2 strcpy may overflow the target buffer (the
code relies on a constant for the max allowed workspace name length).
As in both cases the temporary copy is not useful because the temp copy
will be strdup'd just after, this patch removes the temporary buffer and
uses directly the string.
Signed-off-by: Christophe CURIS <[email protected]>
diff --git a/src/dock.c b/src/dock.c
index 2b8925b2..8b135689 100644
--- a/src/dock.c
+++ b/src/dock.c
@@ -948,7 +948,6 @@ static void launchDockedApplication(WAppIcon *btn, Bool
withSelection)
static void updateWorkspaceMenu(WMenu *menu, WAppIcon *icon)
{
WScreen *scr = menu->frame->screen_ptr;
- char title[MAX_WORKSPACENAME_WIDTH + 1];
int i;
if (!menu || !icon)
@@ -958,15 +957,12 @@ static void updateWorkspaceMenu(WMenu *menu, WAppIcon
*icon)
if (i < menu->entry_no) {
if (strcmp(menu->entries[i]->text,
scr->workspaces[i]->name) != 0) {
wfree(menu->entries[i]->text);
- strcpy(title, scr->workspaces[i]->name);
- menu->entries[i]->text = wstrdup(title);
+ menu->entries[i]->text =
wstrdup(scr->workspaces[i]->name);
menu->flags.realized = 0;
}
menu->entries[i]->clientdata = (void *)icon;
} else {
- strcpy(title, scr->workspaces[i]->name);
-
- wMenuAddCallback(menu, title, switchWSCommand, (void
*)icon);
+ wMenuAddCallback(menu, scr->workspaces[i]->name,
switchWSCommand, (void *)icon);
menu->flags.realized = 0;
}
http://repo.or.cz/w/wmaker-crm.git/commit/7bf256531609c11747a5037e8e8c65a949e9f107
commit 7bf256531609c11747a5037e8e8c65a949e9f107
Author: Christophe CURIS <[email protected]>
Date: Sat Nov 29 16:35:22 2014 +0100
wmaker: replaced temporary allocation by local storage for error message
In case of problem with a directory when building the list of files for the
Icon Chooser dialog, an error message was generated using a temporary
allocated buffer. This is not really good for memory fragmentation, so this
patch re-uses the local buffer which will be enough for all reasonable
cases.
Took opportunity to make message less prone to translation difficulties,
and include more information about the problem to the user so he may know
what went wrong.
Signed-off-by: Christophe CURIS <[email protected]>
diff --git a/po/be.po b/po/be.po
index 846452a1..218da1d7 100644
--- a/po/be.po
+++ b/po/be.po
@@ -306,8 +306,8 @@ msgid "Cancel"
msgstr "Адмена"
#: ../src/dialog.c:299
-msgid "Could not open directory "
-msgstr "Немагчыма адкрыць каталаг "
+msgid "Could not open directory "%s":n%s"
+msgstr "Немагчыма адкрыць каталаг "%s":n%s"
#: ../src/dialog.c:354
msgid "Could not load image file "
diff --git a/po/bg.po b/po/bg.po
index 5a8d396c..8f1aed0c 100644
--- a/po/bg.po
+++ b/po/bg.po
@@ -423,8 +423,8 @@ msgstr "Отменям"
#
# ../src/dialog.c:225
#: ../src/dialog.c:299
-msgid "Could not open directory "
-msgstr "Не може да бъде отворена директорията "
+msgid "Could not open directory "%s":n%s"
+msgstr "Не може да бъде отворена директорията "%s":n%s"
# ../src/dialog.c:280
#: ../src/dialog.c:354
diff --git a/po/bs.po b/po/bs.po
index 76b99a31..c8ed2447 100644
--- a/po/bs.po
+++ b/po/bs.po
@@ -212,8 +212,8 @@ msgid "Cancel"
msgstr "Poništi"
#: ../src/dialog.c:210
-msgid "Could not open directory "
-msgstr "Ne mogu otvoriti direktorij "
+msgid "Could not open directory "%s":n%s"
+msgstr "Ne mogu otvoriti direktorij "%s":n%s"
#: ../src/dialog.c:266
msgid "Could not load image file "
diff --git a/po/ca.po b/po/ca.po
index 96eec2b4..cc020764 100644
--- a/po/ca.po
+++ b/po/ca.po
@@ -321,8 +321,8 @@ msgid "Cancel"
msgstr "Cancel·la"
#: ../src/dialog.c:290
-msgid "Could not open directory "
-msgstr "No s'ha pogut obrir el directori"
+msgid "Could not open directory "%s":n%s"
+msgstr "No s'ha pogut obrir el directori "%s":n%s"
#: ../src/dialog.c:345
msgid "Could not load image file "
diff --git a/po/cs.po b/po/cs.po
index 8a7d0e8e..8d651ba8 100644
--- a/po/cs.po
+++ b/po/cs.po
@@ -312,8 +312,8 @@ msgid "Cancel"
msgstr "Zrušit"
#: ../src/dialog.c:219
-msgid "Could not open directory "
-msgstr "Nelze otevřít adresář"
+msgid "Could not open directory "%s":n%s"
+msgstr "Nelze otevřít adresář "%s":n%s"
#: ../src/dialog.c:274
msgid "Could not load image file "
diff --git a/po/da.po b/po/da.po
index 6d6242e7..b88cfad3 100644
--- a/po/da.po
+++ b/po/da.po
@@ -385,8 +385,8 @@ msgstr "Annullér"
# ../src/dialog.c:218
#: ../src/dialog.c:277
-msgid "Could not open directory "
-msgstr "Kunne ikke åbne mappe "
+msgid "Could not open directory "%s":n%s"
+msgstr "Kunne ikke åbne mappe "%s":n%s"
# ../src/dialog.c:271
#: ../src/dialog.c:332
diff --git a/po/de.po b/po/de.po
index 5273b273..41c7df33 100644
--- a/po/de.po
+++ b/po/de.po
@@ -335,8 +335,8 @@ msgid "Cancel"
msgstr "Abbrechen"
#: ../src/dialog.c:563
-msgid "Could not open directory "
-msgstr "Verzeichnis konnte nicht geöffnet werden"
+msgid "Could not open directory "%s":n%s"
+msgstr "Verzeichnis konnte nicht geöffnet werden "%s":n%s"
#: ../src/dialog.c:613
msgid "Could not load image file "
diff --git a/po/el.po b/po/el.po
index 5b599a11..b2b5e79c 100644
--- a/po/el.po
+++ b/po/el.po
@@ -260,8 +260,8 @@ msgid "Cancel"
msgstr "Άκυρο"
#: ../src/dialog.c:218
-msgid "Could not open directory "
-msgstr "Αδύνατο να ανοιχθεί ο κατάλογος "
+msgid "Could not open directory "%s":n%s"
+msgstr "Αδύνατο να ανοιχθεί ο κατάλογος "%s":n%s"
#: ../src/dialog.c:271
msgid "Could not load image file "
diff --git a/po/es.po b/po/es.po
index 066f5446..6603e50a 100644
--- a/po/es.po
+++ b/po/es.po
@@ -342,8 +342,8 @@ msgid "Cancel"
msgstr "Cancelar"
#: ../src/dialog.c:558
-msgid "Could not open directory "
-msgstr "No se pudo abrir el directorio "
+msgid "Could not open directory "%s":n%s"
+msgstr "No se pudo abrir el directorio "%s":n%s"
#: ../src/dialog.c:608
msgid "Could not load image file "
diff --git a/po/et.po b/po/et.po
index dc7f4eec..868f69c3 100644
--- a/po/et.po
+++ b/po/et.po
@@ -341,8 +341,8 @@ msgid "Cancel"
msgstr "Loobu"
#: ../src/dialog.c:558
-msgid "Could not open directory "
-msgstr "Pole võimalik avada kataloogi "
+msgid "Could not open directory "%s":n%s"
+msgstr "Pole võimalik avada kataloogi "%s":n%s"
#: ../src/dialog.c:608
msgid "Could not load image file "
diff --git a/po/fi.po b/po/fi.po
index 8f599ede..f82c92e7 100644
--- a/po/fi.po
+++ b/po/fi.po
@@ -304,8 +304,8 @@ msgid "Cancel"
msgstr "Peruuta"
#: ../src/dialog.c:219
-msgid "Could not open directory "
-msgstr "Ei voi avata hakemistoa "
+msgid "Could not open directory "%s":n%s"
+msgstr "Ei voi avata hakemistoa "%s":n%s"
#: ../src/dialog.c:274
msgid "Could not load image file "
diff --git a/po/fr.po b/po/fr.po
index d163709f..21e7d393 100644
--- a/po/fr.po
+++ b/po/fr.po
@@ -311,8 +311,8 @@ msgid "Cancel"
msgstr "Annuler"
#: ../src/dialog.c:290
-msgid "Could not open directory "
-msgstr "Impossible d'accéder au répertoire "
+msgid "Could not open directory "%s":n%s"
+msgstr "Impossible d'accéder au répertoire « %s »:n%s"
#: ../src/dialog.c:345
msgid "Could not load image file "
diff --git a/po/gl.po b/po/gl.po
index 79157ed7..304f7f43 100644
--- a/po/gl.po
+++ b/po/gl.po
@@ -304,8 +304,8 @@ msgid "Cancel"
msgstr "Cancelar"
#: ../src/dialog.c:225
-msgid "Could not open directory "
-msgstr "Non foi posible abri-lo directorio "
+msgid "Could not open directory "%s":n%s"
+msgstr "Non foi posible abri-lo directorio "%s":n%s"
#: ../src/dialog.c:280
msgid "Could not load image file "
diff --git a/po/hr.po b/po/hr.po
index 6c992464..61e77c77 100644
--- a/po/hr.po
+++ b/po/hr.po
@@ -211,8 +211,8 @@ msgid "Cancel"
msgstr "Otkaži"
#: ../src/dialog.c:210
-msgid "Could not open directory "
-msgstr "Ne mogu otvoriti direktorij "
+msgid "Could not open directory "%s":n%s"
+msgstr "Ne mogu otvoriti direktorij "%s":n%s"
#: ../src/dialog.c:266
msgid "Could not load image file "
diff --git a/po/hu.po b/po/hu.po
index 10d14289..19ffdb85 100644
--- a/po/hu.po
+++ b/po/hu.po
@@ -332,8 +332,8 @@ msgid "Cancel"
msgstr "Mégsem"
#: ../../wmaker-crm/src/dialog.c:576
-msgid "Could not open directory "
-msgstr "Nem sikerült megnyitni ezt a könyvtárat: "
+msgid "Could not open directory "%s":n%s"
+msgstr "Nem sikerült megnyitni ezt a könyvtárat "%s":n%s"
#: ../../wmaker-crm/src/dialog.c:626
msgid "Could not load image file "
diff --git a/po/hy.po b/po/hy.po
index e2616f75..7fa200f1 100644
--- a/po/hy.po
+++ b/po/hy.po
@@ -407,8 +407,8 @@ msgid "Cancel"
msgstr "Հրաժարվել"
#: ../src/dialog.c:290
-msgid "Could not open directory "
-msgstr "Հնարավոր չէ բացել պանակը"
+msgid "Could not open directory "%s":n%s"
+msgstr "Հնարավոր չէ բացել պանակը "%s":n%s"
#: ../src/dialog.c:345
msgid "Could not load image file "
diff --git a/po/it.po b/po/it.po
index 53bbc8a8..3176dcbf 100644
--- a/po/it.po
+++ b/po/it.po
@@ -345,8 +345,8 @@ msgid "Cancel"
msgstr "Annulla"
#: ../src/dialog.c:290
-msgid "Could not open directory "
-msgstr "Impossibile aprire la directory "
+msgid "Could not open directory "%s":n%s"
+msgstr "Impossibile aprire la directory "%s":n%s"
#: ../src/dialog.c:345
msgid "Could not load image file "
diff --git a/po/ja.po b/po/ja.po
index 93b51898..163ad362 100644
--- a/po/ja.po
+++ b/po/ja.po
@@ -329,8 +329,8 @@ msgid "Cancel"
msgstr "キャンセル"
#: ../src/dialog.c:558
-msgid "Could not open directory "
-msgstr "ディレクトリを開けません"
+msgid "Could not open directory "%s":n%s"
+msgstr "ディレクトリを開けません "%s":n%s"
#: ../src/dialog.c:608
msgid "Could not load image file "
diff --git a/po/ko.po b/po/ko.po
index 831b0182..1963dc7a 100644
--- a/po/ko.po
+++ b/po/ko.po
@@ -322,8 +322,8 @@ msgid "Cancel"
msgstr "취소"
#: ../src/dialog.c:574
-msgid "Could not open directory "
-msgstr "디렉터리를 열 수 없음 "
+msgid "Could not open directory "%s":n%s"
+msgstr "디렉터리를 열 수 없음 "%s":n%s"
#: ../src/dialog.c:624
msgid "Could not load image file "
diff --git a/po/ms.po b/po/ms.po
index 04ddec69..d419bde5 100644
--- a/po/ms.po
+++ b/po/ms.po
@@ -304,8 +304,8 @@ msgid "Cancel"
msgstr "Batal"
#: ../src/dialog.c:277
-msgid "Could not open directory "
-msgstr "Tak dapat membuka direktori"
+msgid "Could not open directory "%s":n%s"
+msgstr "Tak dapat membuka direktori "%s":n%s"
#: ../src/dialog.c:332
msgid "Could not load image file "
diff --git a/po/nl.po b/po/nl.po
index 88c72327..66db08f4 100644
--- a/po/nl.po
+++ b/po/nl.po
@@ -327,8 +327,8 @@ msgid "Cancel"
msgstr "Annuleren"
#: ../src/dialog.c:577
-msgid "Could not open directory "
-msgstr "Openen mislukt van map "
+msgid "Could not open directory "%s":n%s"
+msgstr "Openen mislukt van map "%s":n%s"
#: ../src/dialog.c:628
msgid "Could not load image file "
diff --git a/po/pl.po b/po/pl.po
index af594321..88a214db 100644
--- a/po/pl.po
+++ b/po/pl.po
@@ -227,8 +227,8 @@ msgid "Cancel"
msgstr "Anuluj"
#: ../src/dialog.c:211
-msgid "Could not open directory "
-msgstr "Nie można otworzyć katalogu "
+msgid "Could not open directory "%s":n%s"
+msgstr "Nie można otworzyć katalogu "%s":n%s"
#: ../src/dialog.c:267
msgid "Could not load image file "
diff --git a/po/pt.po b/po/pt.po
index 0f1fc39a..37e080fd 100644
--- a/po/pt.po
+++ b/po/pt.po
@@ -295,8 +295,8 @@ msgid "Cancel"
msgstr "Cancelar"
#: ../src/dialog.c:225
-msgid "Could not open directory "
-msgstr "Não foi possível abrir diretório "
+msgid "Could not open directory "%s":n%s"
+msgstr "Não foi possível abrir diretório "%s":n%s"
#: ../src/dialog.c:280
msgid "Could not load image file "
diff --git a/po/ru.po b/po/ru.po
index cbcc1c9a..93fc02d1 100644
--- a/po/ru.po
+++ b/po/ru.po
@@ -324,8 +324,8 @@ msgstr "Отказ"
#
#: ../src/dialog.c:299
-msgid "Could not open directory "
-msgstr "Невозможно открыть каталог "
+msgid "Could not open directory "%s":n%s"
+msgstr "Невозможно открыть каталог "%s":n%s"
#: ../src/dialog.c:354
msgid "Could not load image file "
diff --git a/po/sk.po b/po/sk.po
index ca9db10c..5942594b 100644
--- a/po/sk.po
+++ b/po/sk.po
@@ -326,8 +326,8 @@ msgid "Cancel"
msgstr "Zrušiť"
#: ../src/dialog.c:290
-msgid "Could not open directory "
-msgstr "Nemožno otvoriť adresár "
+msgid "Could not open directory "%s":n%s"
+msgstr "Nemožno otvoriť adresár "%s":n%s"
#: ../src/dialog.c:345
msgid "Could not load image file "
diff --git a/po/tr.po b/po/tr.po
index 57bbc61f..46f1528e 100644
--- a/po/tr.po
+++ b/po/tr.po
@@ -195,8 +195,8 @@ msgid "No"
msgstr "Hayır"
#: ../src/dialog.c:268
-msgid "Could not open directory "
-msgstr "Dizin açılamadı"
+msgid "Could not open directory "%s":n%s"
+msgstr "Dizin açılamadı "%s":n%s"
#: ../src/dialog.c:324
msgid "Could not load image file "
diff --git a/po/zh_CN.po b/po/zh_CN.po
index 5af76c33..cf529a57 100644
--- a/po/zh_CN.po
+++ b/po/zh_CN.po
@@ -249,8 +249,8 @@ msgid "Cancel"
msgstr "取消"
#: ../src/dialog.c:218
-msgid "Could not open directory "
-msgstr "不能打开目录 "
+msgid "Could not open directory "%s":n%s"
+msgstr "不能打开目录 "%s":n%s"
#: ../src/dialog.c:271
msgid "Could not load image file "
diff --git a/po/zh_TW.po b/po/zh_TW.po
index 6bac9ac3..dcbd2307 100644
--- a/po/zh_TW.po
+++ b/po/zh_TW.po
@@ -340,8 +340,8 @@ msgid "Cancel"
msgstr "取消"
#: ../src/dialog.c:290
-msgid "Could not open directory "
-msgstr "無法開啟目錄"
+msgid "Could not open directory "%s":n%s"
+msgstr "無法開啟目錄 "%s":n%s"
#: ../src/dialog.c:345
msgid "Could not load image file "
diff --git a/src/dialog.c b/src/dialog.c
index d14d336e..6bb34246 100644
--- a/src/dialog.c
+++ b/src/dialog.c
@@ -35,6 +35,7 @@
#include <sys/stat.h>
#include <dirent.h>
#include <limits.h>
+#include <errno.h>
#ifdef HAVE_MALLOC_H
#include <malloc.h>
@@ -572,16 +573,11 @@ static void listPixmaps(WScreen *scr, WMList *lPtr, const
char *path)
dir = opendir(apath);
if (!dir) {
- char *msg;
- char *tmp;
- tmp = _("Could not open directory ");
- msg = wmalloc(strlen(tmp) + strlen(path) + 6);
- strcpy(msg, tmp);
- strcat(msg, path);
-
- wMessageDialog(scr, _("Error"), msg, _("OK"), NULL, NULL);
- wfree(msg);
wfree(apath);
+ snprintf(pbuf, sizeof(pbuf),
+ _("Could not open directory "%s":n%s"),
+ path, strerror(errno));
+ wMessageDialog(scr, _("Error"), pbuf, _("OK"), NULL, NULL);
return;
}
http://repo.or.cz/w/wmaker-crm.git/commit/7542451a046535ba7ed9919dc9610a822c796904
commit 7542451a046535ba7ed9919dc9610a822c796904
Author: Christophe CURIS <[email protected]>
Date: Sat Nov 29 16:35:21 2014 +0100
wmaker: fix possible buffer overrun with filename for Icon Chooser
(Coverity #50218)
As pointed by Coverity, there is a possible (yet improbable) buffer overrun
when building the list of files to be used in the Icon Chooser dialog.
Better safe than sorry, let's use the safer function to build the complete
name, and add a little message to the user in case of problem so at least
he can know something was not right.
Signed-off-by: Christophe CURIS <[email protected]>
diff --git a/src/dialog.c b/src/dialog.c
index 3d5d9d01..d14d336e 100644
--- a/src/dialog.c
+++ b/src/dialog.c
@@ -592,9 +592,13 @@ static void listPixmaps(WScreen *scr, WMList *lPtr, const
char *path)
if (strcmp(dentry->d_name, ".") == 0 || strcmp(dentry->d_name,
"..") == 0)
continue;
- strcpy(pbuf, apath);
- strcat(pbuf, "/");
- strcat(pbuf, dentry->d_name);
+ 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);
+ continue;
+ }
if (stat(pbuf, &statb) < 0)
continue;
http://repo.or.cz/w/wmaker-crm.git/commit/aa8ade1ef1b884c0a338134b6ac1bd3001b8771c
commit aa8ade1ef1b884c0a338134b6ac1bd3001b8771c
Author: Christophe CURIS <[email protected]>
Date: Sat Nov 29 16:35:20 2014 +0100
wmaker: change strcpy to the version with size check (Coverity #50217)
As pointed by Coverity, there were a number of copies done into fixed-size
buffer, it's safer to use the function that sets a limit on the size to
avoid a crash.
Signed-off-by: Christophe CURIS <[email protected]>
diff --git a/src/appmenu.c b/src/appmenu.c
index 126d228c..342cef3c 100644
--- a/src/appmenu.c
+++ b/src/appmenu.c
@@ -90,15 +90,14 @@ static WMenu *parseMenuCommand(WScreen * scr, Window win,
char **slist, int coun
char title[300];
char rtext[300];
- if (strlen(slist[*index]) > sizeof(title) - 1) {
- wwarning("appmenu: menu command size exceeded in window %lx",
win);
- return NULL;
- }
if (sscanf(slist[*index], "%i %i %n", &command, &code, &pos) < 2 ||
command != wmBeginMenu) {
wwarning("appmenu: bad menu entry "%s" in window %lx",
slist[*index], win);
return NULL;
}
- strcpy(title, &slist[*index][pos]);
+ if (wstrlcpy(title, &slist[*index][pos], sizeof(title)) >=
sizeof(title)) {
+ wwarning("appmenu: menu command size exceeded in window %lx",
win);
+ return NULL;
+ }
menu = wMenuCreateForApp(scr, title, *index == 1);
if (!menu)
return NULL;
@@ -128,7 +127,7 @@ static WMenu *parseMenuCommand(WScreen * scr, Window win,
char **slist, int coun
slist[*index], win);
return NULL;
}
- strcpy(title, &slist[*index][pos]);
+ wstrlcpy(title, &slist[*index][pos],
sizeof(title));
rtext[0] = 0;
} else {
if (sscanf(slist[*index], "%i %i %i %i %s %n",
@@ -138,7 +137,7 @@ static WMenu *parseMenuCommand(WScreen * scr, Window win,
char **slist, int coun
slist[*index], win);
return NULL;
}
- strcpy(title, &slist[*index][pos]);
+ wstrlcpy(title, &slist[*index][pos],
sizeof(title));
}
if (!(data = malloc(sizeof(WAppMenuData)))) {
wwarning("appmenu: out of memory making menu
for window %lx", win);
@@ -174,7 +173,7 @@ static WMenu *parseMenuCommand(WScreen * scr, Window win,
char **slist, int coun
return NULL;
}
- strcpy(title, &slist[*index][pos]);
+ wstrlcpy(title, &slist[*index][pos], sizeof(title));
*index += 1;
submenu = parseMenuCommand(scr, win, slist, count,
index);
http://repo.or.cz/w/wmaker-crm.git/commit/1b00071c266a7beba53be7b7f2e8c808e5bdb8a8
commit 1b00071c266a7beba53be7b7f2e8c808e5bdb8a8
Author: Christophe CURIS <[email protected]>
Date: Sat Nov 29 16:35:19 2014 +0100
wmaker: add check for null pointer in wAppIconCreateForDock (Coverity
#50053)
As pointed by Coverity, there is in the same procedure a check for null
pointer before use, and later a direct use without check.
In most case, the pointer is not null, but it one case it is hard to be
sure that the pointer cannot be null, so it's safer to just add a check
there also.
Took opportunity to swap the order of the arguments in the if, because if
the config flag is false it is not necessary to spend time on doing the
more expensive strcmp.
Signed-off-by: Christophe CURIS <[email protected]>
diff --git a/src/appicon.c b/src/appicon.c
index 1d28a245..ed03ffc1 100644
--- a/src/appicon.c
+++ b/src/appicon.c
@@ -126,7 +126,7 @@ WAppIcon *wAppIconCreateForDock(WScreen *scr, const char
*command, const char *w
if (wm_instance)
aicon->wm_instance = wstrdup(wm_instance);
- if (strcmp(wm_class, "WMDock") == 0 &&
wPreferences.flags.clip_merged_in_dock)
+ if (wPreferences.flags.clip_merged_in_dock && wm_class != NULL &&
strcmp(wm_class, "WMDock") == 0)
tile = TILE_CLIP;
aicon->icon = icon_create_for_dock(scr, command, wm_instance, wm_class,
tile);
http://repo.or.cz/w/wmaker-crm.git/commit/63733c913316861582f2330c13741ef3862d4d87
commit 63733c913316861582f2330c13741ef3862d4d87
Author: Christophe CURIS <[email protected]>
Date: Sat Nov 29 16:35:18 2014 +0100
WINGs: fix possible problems due to sign extension when setting Icon
(Coverity #50202)
As pointed by Coverity, there might be some problems due to sign extension
when performing the shifts and ors operations when converting the RImage to
the format expected for the WM_ICON property.
This patch try to improve things by using as much as possible unsigned
types and by using explicit types conversion instead of counting on the
wrong implicit type conversion done by the language.
Signed-off-by: Christophe CURIS <[email protected]>
diff --git a/WINGs/wwindow.c b/WINGs/wwindow.c
index a04ab6ae..28844fb9 100644
--- a/WINGs/wwindow.c
+++ b/WINGs/wwindow.c
@@ -217,7 +217,7 @@ static void setMiniwindowTitle(WMWindow * win, const char
*title)
static void setMiniwindow(WMWindow *win, RImage *image)
{
WMScreen *scr = win->view->screen;
- long *data;
+ unsigned long *data;
int x, y;
int o;
@@ -232,15 +232,19 @@ static void setMiniwindow(WMWindow *win, RImage *image)
for (y = 0; y < image->height; y++) {
for (x = 0; x < image->width; x++) {
- long pixel;
+ unsigned long pixel;
int offs = (x + y * image->width);
- if (image->format == RRGBFormat)
- pixel = image->data[offs * 3] << 16 |
image->data[offs * 3 + 1] << 8
- | image->data[offs * 3 + 2];
- else
- pixel = image->data[offs * 4] << 16 |
image->data[offs * 4 + 1] << 8
- | image->data[offs * 4 + 2] |
image->data[offs * 4 + 3] << 24;
+ if (image->format == RRGBFormat) {
+ pixel = ((unsigned long) image->data[offs * 3
]) << 16;
+ pixel |= ((unsigned long) image->data[offs * 3
+ 1]) << 8;
+ pixel |= ((unsigned long) image->data[offs * 3
+ 2]);
+ } else {
+ pixel = ((unsigned long) image->data[offs * 4
]) << 16;
+ pixel |= ((unsigned long) image->data[offs * 4
+ 1]) << 8;
+ pixel |= ((unsigned long) image->data[offs * 4
+ 2]);
+ pixel |= ((unsigned long) image->data[offs * 4
+ 3]) << 24;
+ }
data[o++] = pixel;
}
http://repo.or.cz/w/wmaker-crm.git/commit/c5d4c27a90dfe728e3fdeabd3b3c42e2ec38cca5
commit c5d4c27a90dfe728e3fdeabd3b3c42e2ec38cca5
Author: Christophe CURIS <[email protected]>
Date: Sat Nov 29 16:35:17 2014 +0100
WINGs: to not allocate memory for a short lived array (Coverity #50136)
As pointed by Coverity, the array created to temporary store the list of
Atoms used in the function 'requestHandler' was leaked.
Because this array is very short lived, there is no need to allocate memory
for this, it just participates in memory fragmentation. Instead, we use now
memory on the stack which is more efficient.
Signed-off-by: Christophe CURIS <[email protected]>
diff --git a/WINGs/wtext.c b/WINGs/wtext.c
index 5981de38..93090e40 100644
--- a/WINGs/wtext.c
+++ b/WINGs/wtext.c
@@ -2061,15 +2061,14 @@ static WMData *requestHandler(WMView * view, Atom
selection, Atom target, void *
_TARGETS = XInternAtom(dpy, "TARGETS", False);
if (target == _TARGETS) {
- Atom *ptr;
+ Atom array[4];
- ptr = wmalloc(4 * sizeof(Atom));
- ptr[0] = _TARGETS;
- ptr[1] = XA_STRING;
- ptr[2] = TEXT;
- ptr[3] = COMPOUND_TEXT;
+ array[0] = _TARGETS;
+ array[1] = XA_STRING;
+ array[2] = TEXT;
+ array[3] = COMPOUND_TEXT;
- data = WMCreateDataWithBytes(ptr, 4 * 4);
+ data = WMCreateDataWithBytes(&array, sizeof(array));
WMSetDataFormat(data, 32);
*type = target;
http://repo.or.cz/w/wmaker-crm.git/commit/b80118fb419107e1af935c61dbe37e6a0db542f7
commit b80118fb419107e1af935c61dbe37e6a0db542f7
Author: Christophe CURIS <[email protected]>
Date: Sat Nov 29 16:35:16 2014 +0100
WINGs: fix WMPathForResourceOfType to check for all the paths it claims to
check
The "documentation" of the function claims to check for the resource in a
number of path, but factually if the application did provide its argument
list when creating the WINGs App structure (which is likely) then the
search would stop before checking all paths.
The code now continues as expectable if the resource was not found in the
path. Took opportunity to avoid a temporary allocation that participated in
memory fragmentation.
Signed-off-by: Christophe CURIS <[email protected]>
diff --git a/WINGs/wapplication.c b/WINGs/wapplication.c
index 90874c06..39b37d96 100644
--- a/WINGs/wapplication.c
+++ b/WINGs/wapplication.c
@@ -131,11 +131,10 @@ error:
char *WMPathForResourceOfType(const char *resource, const char *ext)
{
- char *path, *tmp, *appdir;
- int i;
+ char *path, *appdir;
size_t slen;
- path = tmp = appdir = NULL;
+ path = appdir = NULL;
/*
* Paths are searched in this order:
@@ -156,17 +155,19 @@ char *WMPathForResourceOfType(const char *resource, const
char *ext)
}
if (WMApplication.argv[0]) {
- tmp = wstrdup(WMApplication.argv[0]);
- i = strlen(tmp);
- while (i > 0 && tmp[i] != '/')
- i--;
- tmp[i] = 0;
- if (i > 0) {
+ char *ptr_slash;
+
+ ptr_slash = strrchr(WMApplication.argv[0], '/');
+ if (ptr_slash != NULL) {
+ char tmp[ptr_slash - WMApplication.argv[0] + 1];
+
+ strncpy(tmp, WMApplication.argv[0], sizeof(tmp)-1);
+ tmp[sizeof(tmp) - 1] = '0';
+
path = checkFile(tmp, NULL, ext, resource);
- } else {
- path = NULL;
+ if (path)
+ goto out;
}
- goto out;
}
slen = strlen(WMApplication.applicationName) +
sizeof("Applications/.app");
@@ -197,8 +198,6 @@ char *WMPathForResourceOfType(const char *resource, const
char *ext)
path = checkFile("/usr/GNUstep", appdir, ext, resource); /* falls
through */
out:
- if (tmp)
- wfree(tmp);
if (appdir)
wfree(appdir);
-----------------------------------------------------------------------
Summary of changes:
WINGs/wapplication.c | 27 +++++++++++++--------------
WINGs/wtext.c | 13 ++++++-------
WINGs/wwindow.c | 20 ++++++++++++--------
WPrefs.app/Appearance.c | 9 +++++++--
po/be.po | 4 ++--
po/bg.po | 4 ++--
po/bs.po | 4 ++--
po/ca.po | 4 ++--
po/cs.po | 4 ++--
po/da.po | 4 ++--
po/de.po | 4 ++--
po/el.po | 4 ++--
po/es.po | 4 ++--
po/et.po | 4 ++--
po/fi.po | 4 ++--
po/fr.po | 4 ++--
po/gl.po | 4 ++--
po/hr.po | 4 ++--
po/hu.po | 4 ++--
po/hy.po | 4 ++--
po/it.po | 4 ++--
po/ja.po | 4 ++--
po/ko.po | 4 ++--
po/ms.po | 4 ++--
po/nl.po | 4 ++--
po/pl.po | 4 ++--
po/pt.po | 4 ++--
po/ru.po | 4 ++--
po/sk.po | 4 ++--
po/tr.po | 4 ++--
po/zh_CN.po | 4 ++--
po/zh_TW.po | 4 ++--
src/appicon.c | 2 +-
src/appmenu.c | 15 +++++++--------
src/dialog.c | 24 ++++++++++++------------
src/dock.c | 14 +++++---------
src/event.c | 9 ++++++++-
src/wmspec.c | 27 ++++++++++++++++++---------
src/xdnd.c | 3 +--
util/getstyle.c | 3 ++-
40 files changed, 148 insertions(+), 130 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].