Fix CVE-2018-19387

This commit is contained in:
npt-1707 2026-03-10 00:19:33 +08:00 committed by Nicolas Viennot
parent ac919516f4
commit 3e12f558c7
4 changed files with 12 additions and 0 deletions

View file

@ -468,6 +468,8 @@ format_cb_pane_tabs(struct format_tree *ft, struct format_entry *fe)
return;
buffer = evbuffer_new();
if (buffer == NULL)
fatalx("out of memory");
for (i = 0; i < wp->base.grid->sx; i++) {
if (!bit_test(wp->base.tabs, i))
continue;

View file

@ -766,6 +766,8 @@ input_init(struct window_pane *wp)
ictx->input_buf = xmalloc(INPUT_BUF_START);
ictx->since_ground = evbuffer_new();
if (ictx->since_ground == NULL)
fatalx("out of memory");
input_reset(wp, 0);
}

View file

@ -121,8 +121,14 @@ server_client_create(int fd)
c->cmdq->client_exit = 1;
c->stdin_data = evbuffer_new();
if (c->stdin_data == NULL)
fatalx("out of memory");
c->stdout_data = evbuffer_new();
if (c->stdout_data == NULL)
fatalx("out of memory");
c->stderr_data = evbuffer_new();
if (c->stderr_data == NULL)
fatalx("out of memory");
c->tty.fd = -1;
c->title = NULL;

View file

@ -945,6 +945,8 @@ window_pane_spawn(struct window_pane *wp, int argc, char **argv,
wp->event = bufferevent_new(wp->fd, window_pane_read_callback, NULL,
window_pane_error_callback, wp);
if (wp->event == NULL)
fatalx("out of memory");
bufferevent_setwatermark(wp->event, EV_READ, 0, READ_SIZE);
bufferevent_enable(wp->event, EV_READ|EV_WRITE);