summaryrefslogtreecommitdiff
path: root/0001-CVE-2022-47016.patch
blob: 456086938f2e748a89f8d1fa83142629cd6499d9 (plain)
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
Index: tmux-3.3a/control.c
===================================================================
--- tmux-3.3a.orig/control.c
+++ tmux-3.3a/control.c
@@ -775,6 +775,9 @@ control_start(struct client *c)
 
 	cs->read_event = bufferevent_new(c->fd, control_read_callback,
 	    control_write_callback, control_error_callback, c);
+	if (cs->read_event == NULL)
+		fatalx("out of memory");
+
 	bufferevent_enable(cs->read_event, EV_READ);
 
 	if (c->flags & CLIENT_CONTROLCONTROL)
@@ -782,6 +785,8 @@ control_start(struct client *c)
 	else {
 		cs->write_event = bufferevent_new(c->out_fd, NULL,
 		    control_write_callback, control_error_callback, c);
+		if (cs->write_event == NULL)
+			fatalx("out of memory");
 	}
 	bufferevent_setwatermark(cs->write_event, EV_WRITE, CONTROL_BUFFER_LOW,
 	    0);
Index: tmux-3.3a/file.c
===================================================================
--- tmux-3.3a.orig/file.c
+++ tmux-3.3a/file.c
@@ -585,6 +585,8 @@ file_write_open(struct client_files *fil
 
 	cf->event = bufferevent_new(cf->fd, NULL, file_write_callback,
 	    file_write_error_callback, cf);
+	if (cf->event == NULL)
+		fatalx("out of memory");
 	bufferevent_enable(cf->event, EV_WRITE);
 	goto reply;
 
@@ -744,6 +746,8 @@ file_read_open(struct client_files *file
 
 	cf->event = bufferevent_new(cf->fd, file_read_callback, NULL,
 	    file_read_error_callback, cf);
+	if (cf->event == NULL)
+		fatalx("out of memory");
 	bufferevent_enable(cf->event, EV_READ);
 	return;
 
Index: tmux-3.3a/window.c
===================================================================
--- tmux-3.3a.orig/window.c
+++ tmux-3.3a/window.c
@@ -1042,6 +1042,8 @@ window_pane_set_event(struct window_pane
 
 	wp->event = bufferevent_new(wp->fd, window_pane_read_callback,
 	    NULL, window_pane_error_callback, wp);
+	if (wp->event == NULL)
+		fatalx("out of memory");
 	wp->ictx = input_init(wp, wp->event, &wp->palette);
 
 	bufferevent_enable(wp->event, EV_READ|EV_WRITE);