All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lukas Czerner <lczerner@redhat.com>
To: tytso@mit.edu
Cc: linux-ext4@vger.kernel.org
Subject: [PATCH 6/7] libss: Add missing error handling for fdopen()
Date: Fri,  6 Aug 2021 11:58:19 +0200	[thread overview]
Message-ID: <20210806095820.83731-6-lczerner@redhat.com> (raw)
In-Reply-To: <20210806095820.83731-1-lczerner@redhat.com>

Signed-off-by: Lukas Czerner <lczerner@redhat.com>
---
 lib/ss/list_rqs.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/lib/ss/list_rqs.c b/lib/ss/list_rqs.c
index 021a3835..89e37bb2 100644
--- a/lib/ss/list_rqs.c
+++ b/lib/ss/list_rqs.c
@@ -12,6 +12,9 @@
  */
 #include "config.h"
 #include "ss_internal.h"
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
 #include <signal.h>
 #include <setjmp.h>
 #include <sys/wait.h>
@@ -46,6 +49,12 @@ void ss_list_requests(int argc __SS_ATTR((unused)),
         return;
     }
     output = fdopen(fd, "w");
+    if (!output) {
+        perror("fdopen");
+        close(fd);
+        (void) signal(SIGINT, func);
+        return;
+    }
     sigprocmask(SIG_SETMASK, &omask, (sigset_t *) 0);
 
     fprintf (output, "Available %s requests:\n\n",
-- 
2.31.1


  parent reply	other threads:[~2021-08-06  9:58 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-06  9:58 [PATCH 1/7] e2fsck: value stored to err is never read Lukas Czerner
2021-08-06  9:58 ` [PATCH 2/7] ext2fs: initialize retval before using it Lukas Czerner
2021-08-10 14:59   ` Theodore Ts'o
2021-08-06  9:58 ` [PATCH 3/7] e2fsprogs: fix unexpected NULL variable Lukas Czerner
2021-08-10 15:01   ` Theodore Ts'o
2021-08-06  9:58 ` [PATCH 4/7] e2fsprogs: remove augmented rbtree functionality Lukas Czerner
2021-08-10 15:01   ` Theodore Ts'o
2021-08-06  9:58 ` [PATCH 5/7] libss: handle memory allcation failure in ss_help() Lukas Czerner
2021-08-10 15:03   ` Theodore Ts'o
2021-08-06  9:58 ` Lukas Czerner [this message]
2021-08-10 15:03   ` [PATCH 6/7] libss: Add missing error handling for fdopen() Theodore Ts'o
2021-08-06  9:58 ` [PATCH 7/7] mkquota: Fix potental NULL pointer dereference Lukas Czerner
2021-08-10 16:15   ` Theodore Ts'o
2021-08-11 17:32     ` Lukas Czerner
2021-08-10 14:58 ` [PATCH 1/7] e2fsck: value stored to err is never read Theodore Ts'o
2021-08-11 17:33   ` Lukas Czerner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210806095820.83731-6-lczerner@redhat.com \
    --to=lczerner@redhat.com \
    --cc=linux-ext4@vger.kernel.org \
    --cc=tytso@mit.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.