1
0
mirror of https://github.com/openbsd/src.git synced 2026-06-19 15:53:31 +02:00

Do not deref NULL job in window_copy_pipe_run when job_run fails. From

Barrett Ruth in GitHub issue 5036.
This commit is contained in:
nicm
2026-04-28 08:35:21 +00:00
parent e0776bf12f
commit 7e3db155b5
+3 -2
View File
@@ -1,4 +1,4 @@
/* $OpenBSD: window-copy.c,v 1.394 2026/04/22 07:03:06 nicm Exp $ */
/* $OpenBSD: window-copy.c,v 1.395 2026/04/28 08:35:21 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -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);
}