From 645bf8b3ab9606bff1d94842ea14556c9f1d620a Mon Sep 17 00:00:00 2001 From: nicm Date: Wed, 21 Jun 2023 06:28:18 +0000 Subject: [PATCH] Check fdopen return value, from Christian Menges. --- popup.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/popup.c b/popup.c index 2195adf5..9ab8490f 100644 --- a/popup.c +++ b/popup.c @@ -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);