From: nicm Date: Wed, 21 Jun 2023 06:28:18 +0000 (+0000) Subject: Check fdopen return value, from Christian Menges. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=0b091dd3e43f8d193d16fbeaa249e595f821f060;p=openbsd Check fdopen return value, from Christian Menges. --- 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 @@ -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);