about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAnselm R. Garbe <arg@suckless.org>2007-03-29 15:17:57 +0200
committerAnselm R. Garbe <arg@suckless.org>2007-03-29 15:17:57 +0200
commit06f9f346e650dfa2439836f3b01c8d1b242c2aee (patch)
treedac444867330eb0c23bb2d078d441796b0f167da
parent5c48012ad25de8eb97818de9bff7c7021f5fe52f (diff)
downloaddwm-06f9f346e650dfa2439836f3b01c8d1b242c2aee.tar.gz
add an additional check in resize() to prevent a crash of dwm
-rw-r--r--client.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/client.c b/client.c
index 1844713..282ad53 100644
--- a/client.c
+++ b/client.c
@@ -233,7 +233,7 @@ resize(Client *c, int x, int y, int w, int h, Bool sizehints) {
 	if(w <= 0 || h <= 0)
 		return;
 	if(sizehints) {
-		if(c->minay > 0 && c->maxay && (h - c->baseh) > 0) {
+		if(c->minay > 0 && c->maxay > 0 && (h - c->baseh) > 0) {
 			dx = (float)(w - c->basew);
 			dy = (float)(h - c->baseh);
 			min = (float)(c->minax) / (float)(c->minay);
@@ -267,6 +267,8 @@ resize(Client *c, int x, int y, int w, int h, Bool sizehints) {
 		if(c->inch)
 			h -= (h - c->baseh) % c->inch;
 	}
+	if(w <= 0 || h <= 0)
+		return;
 	if(w == sw && h == sh)
 		c->border = 0;
 	else
malloc (thx for the pointer to Uriel)' href='/acidbong/suckless/dwm/commit/util.c?h=5.7&id=6a3ae5e26a5cebfd35f2423aec0c47843b5a85be'>6a3ae5e ^
39677ec ^


39677ec ^
8f698bd ^

adaa28a ^
dc5d967 ^
adaa28a ^


849e631 ^
adaa28a ^

d4b7a9a ^




6a3ae5e ^
d4b7a9a ^


adaa28a ^
c47da14 ^
439e15d ^
9955ddc ^
dc5d967 ^
9955ddc ^



439e15d ^
a50b15a ^
439e15d ^



16c67f3 ^
7711ab6 ^
e48de30 ^
439e15d ^

0464e42 ^
439e15d ^


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67