summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@cvs.openbsd.org>2023-06-21 06:28:19 +0000
committerNicholas Marriott <nicm@cvs.openbsd.org>2023-06-21 06:28:19 +0000
commit0d6acdfcc5c7a6e183d046d16672b249f9daf8f0 (patch)
tree3c911217f51e36e6e0318a84cf817679263c4062
parent498d45d43bf88cb6982141561a13bfa4553a69d3 (diff)
Check fdopen return value, from Christian Menges.
-rw-r--r--usr.bin/tmux/popup.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/usr.bin/tmux/popup.c b/usr.bin/tmux/popup.c
index cafbc168c1c..b172f40267b 100644
--- a/usr.bin/tmux/popup.c
+++ b/usr.bin/tmux/popup.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: popup.c,v 1.49 2023/06/08 11:17:28 nicm Exp $ */
+/* $OpenBSD: popup.c,v 1.50 2023/06/21 06:28:18 nicm Exp $ */
/*
* Copyright (c) 2020 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -788,6 +788,8 @@ popup_editor(struct client *c, const char *buf, size_t len,
if (fd == -1)
return (-1);
f = fdopen(fd, "w");
+ if (f == NULL)
+ return (-1);
if (fwrite(buf, len, 1, f) != 1) {
fclose(f);
return (-1);