From 2a5715fad5a3f7c7cec5ba8a0a26b85a0df2c259 Mon Sep 17 00:00:00 2001 From: nicm Date: Tue, 28 Apr 2026 08:35:21 +0000 Subject: [PATCH] Do not deref NULL job in window_copy_pipe_run when job_run fails. From Barrett Ruth in GitHub issue 5036. --- window-copy.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/window-copy.c b/window-copy.c index ac89dc56..0b6bf69a 100644 --- a/window-copy.c +++ b/window-copy.c @@ -5171,7 +5171,8 @@ window_copy_pipe_run(struct window_mode_entry *wme, struct session *s, if (cmd != NULL && *cmd != '\0') { job = job_run(cmd, 0, NULL, NULL, s, NULL, NULL, NULL, NULL, NULL, JOB_NOWAIT, -1, -1); - bufferevent_write(job_get_event(job), buf, *len); + if (job != NULL) + bufferevent_write(job_get_event(job), buf, *len); } return (buf); }