aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoroblique <psyberbits@gmail.com>2012-06-28 06:40:49 +0300
committeroblique <psyberbits@gmail.com>2012-06-28 06:40:49 +0300
commitd9d7a40c19e8927c76e8082001fcc36f3b2bc724 (patch)
tree7d088abe886c8d7884d1eec6f6614f02a4c27916
parent5b4e656cb17a2b1f68be0151dae6ef93c3cee100 (diff)
downloadwmfs-d9d7a40c19e8927c76e8082001fcc36f3b2bc724.zip
wmfs-d9d7a40c19e8927c76e8082001fcc36f3b2bc724.tar.gz
wmfs-d9d7a40c19e8927c76e8082001fcc36f3b2bc724.tar.bz2
Fix some memory corruptions
-rw-r--r--src/event.c17
-rw-r--r--src/status.c3
2 files changed, 12 insertions, 8 deletions
diff --git a/src/event.c b/src/event.c
index 1e680d9..fad754d 100644
--- a/src/event.c
+++ b/src/event.c
@@ -114,19 +114,20 @@ event_clientmessageevent(XEvent *e)
/* Manage _WMFS_FUNCTION && _WMFS_CMD */
if(type == wmfs_function || type == wmfs_cmd)
{
+ Atom rt;
int d;
- long unsigned int len;
+ long unsigned int len, il;
unsigned char *ret = NULL, *ret_cmd = NULL;
void (*func)(Uicb);
if(XGetWindowProperty(EVDPY(e), W->root, W->net_atom[wmfs_function], 0, 65536,
- False, W->net_atom[utf8_string], (Atom*)&d, &d,
- (long unsigned int*)&d, (long unsigned int*)&d, &ret) == Success
+ False, W->net_atom[utf8_string], &rt, &d,
+ &len, &il, &ret) == Success
&& ret && ((func = uicb_name_func((char*)ret))))
{
if(XGetWindowProperty(EVDPY(e), W->root, W->net_atom[wmfs_cmd], 0, 65536,
- False, W->net_atom[utf8_string], (Atom*)&d, &d,
- &len, (long unsigned int*)&d, &ret_cmd) == Success
+ False, W->net_atom[utf8_string], &rt, &d,
+ &len, &il, &ret_cmd) == Success
&& len && ret_cmd)
{
func((Uicb)ret_cmd);
@@ -327,12 +328,14 @@ event_unmapnotify(XEvent *e)
&& ev->send_event
&& ev->event == W->root)
{
+ Atom rt;
+ unsigned long n, il;
int d;
unsigned char *ret = NULL;
if(XGetWindowProperty(EVDPY(e), c->win, W->net_atom[wm_state], 0, 2,
- False, W->net_atom[wm_state], (Atom*)&d, &d,
- (long unsigned int*)&d, (long unsigned int*)&d, &ret) == Success)
+ False, W->net_atom[wm_state], &rt, &d,
+ &n, &il, &ret) == Success)
if(*ret == NormalState)
client_remove(c);
}
diff --git a/src/status.c b/src/status.c
index 2a9e18e..b7245a5 100644
--- a/src/status.c
+++ b/src/status.c
@@ -554,12 +554,13 @@ status_surface(int x, int y, int w, int h, Color bg, char *status)
struct screen *s;
struct status_ctx ctx;
int d;
+ Window rw;
if(!status)
return;
if(x + y < 0)
- XQueryPointer(W->dpy, W->root, (Window*)&d, (Window*)&d, &x, &y, &d, &d, (unsigned int *)&d);
+ XQueryPointer(W->dpy, W->root, &rw, &rw, &x, &y, &d, &d, (unsigned int *)&d);
s = screen_gb_geo(x, y);