Got questions, comments, patches, etc.?
Contact Jason Woofenden
gitweb
/
spectrwm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
5f8a010
)
fix crash on apps that dont play nice with NET_WM_PID.
author
Marco Peereboom
<marco@conformal.com>
Thu, 23 Jun 2011 11:37:16 +0000
(11:37 +0000)
committer
Marco Peereboom
<marco@conformal.com>
Thu, 23 Jun 2011 11:37:16 +0000
(11:37 +0000)
scrotwm.c
patch
|
blob
|
history
diff --git
a/scrotwm.c
b/scrotwm.c
index
2d10ceb
..
499ee6d
100644
(file)
--- a/
scrotwm.c
+++ b/
scrotwm.c
@@
-1063,6
+1063,9
@@
find_pid(long pid)
DNPRINTF(SWM_D_MISC, "find_pid: %lu\n", pid);
DNPRINTF(SWM_D_MISC, "find_pid: %lu\n", pid);
+ if (pid == 0)
+ return (NULL);
+
TAILQ_FOREACH(p, &pidlist, entry) {
if (p->pid == pid)
return (p);
TAILQ_FOREACH(p, &pidlist, entry) {
if (p->pid == pid)
return (p);
@@
-4761,7
+4764,7
@@
window_get_pid(Window win)
int actual_format_return = 0;
unsigned long nitems_return = 0;
unsigned long bytes_after_return = 0;
int actual_format_return = 0;
unsigned long nitems_return = 0;
unsigned long bytes_after_return = 0;
- long *pid = 0;
+ long *pid = NULL;
long ret = 0;
if (XGetWindowProperty(display, win,
long ret = 0;
if (XGetWindowProperty(display, win,
@@
-4770,8
+4773,12
@@
window_get_pid(Window win)
&nitems_return, &bytes_after_return,
(unsigned char**)(void*)&pid) != Success)
return (0);
&nitems_return, &bytes_after_return,
(unsigned char**)(void*)&pid) != Success)
return (0);
+ if (actual_type_return != XA_CARDINAL)
+ return (0);
+ if (pid == NULL)
+ return (0);
- ret = pid[0];
+ ret = *pid;
XFree(pid);
return (ret);
XFree(pid);
return (ret);